The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Rotating Banner Issue

3 posters

Go down

Solved Rotating Banner Issue

Post by itachi uchiha April 22nd 2017, 2:06 pm

Hello so recently, as of yesterday. I used to run a rotating banner that changes every time the page refreshes. I followed the guide you made here on forumotion and then suddenly it just stopped working? I have the code here and everytime I try and do it now, the banner doesn't show at all and just loads nothing. Here is the code.

Code:
$(function() {
  var banners = [
    'http://i38.servimg.com/u/f38/18/21/60/73/b010.png',
    'http://orig11.deviantart.net/ada6/f/2017/094/7/d/nn_by_satoace-db4mn24.png',
 
 
  logo = document.getElementById('i_logo') || document.getElementById('logo') || document.getElementById('pun-logo');
  if (logo) (logo.tagName == 'IMG' ? logo : logo.firstChild).src = banners[Math.floor(Math.random() * banners.length)];
});


Last edited by itachi uchiha on April 27th 2017, 8:46 am; edited 1 time in total
itachi uchiha
itachi uchiha
Forumember

Male Posts : 146
Reputation : 1
Language : English
Location : New Zealand

http://www.narutonexusrp.com/forum

Back to top Go down

Solved Re: Rotating Banner Issue

Post by skouliki April 22nd 2017, 3:25 pm

hello
Rotating Banner Issue B010  I see this as the first image ..is this your banner ?

If not then this image url is broken https://i.servimg.com/u/f38/18/21/60/73/b010.png
Try to reload the banner ( if you have saved it , from your personal files ) and insert into the code the new url

I suggest you save all your images to be sure


Last edited by skouliki on April 23rd 2017, 8:46 am; edited 1 time in total
skouliki
skouliki
Manager
Manager

Female Posts : 15029
Reputation : 1680
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Rotating Banner Issue

Post by Ape April 22nd 2017, 11:29 pm

Please can you post your forum url to the forum you are having the problem.


Rotating Banner Issue Left1212Rotating Banner Issue Center11Rotating Banner Issue Right112
Rotating Banner Issue Ape_b110
Rotating Banner Issue Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19075
Reputation : 1988
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Rotating Banner Issue

Post by itachi uchiha April 23rd 2017, 3:24 pm

At the moment I have the javascript turned off because it removes my entire banner but no that is not the 2 banners. The second banner is this one ( https://i.servimg.com/u/f58/18/76/17/65/nn210.jpg ).


Site Link: http://www.narutonexus.com/
itachi uchiha
itachi uchiha
Forumember

Male Posts : 146
Reputation : 1
Language : English
Location : New Zealand

http://www.narutonexusrp.com/forum

Back to top Go down

Solved Re: Rotating Banner Issue

Post by skouliki April 23rd 2017, 4:18 pm

The http.....png urls with green color at the begging of your code are the banners you want to appear ..correct the urls and retry the code 

Now the code you provide above has the wrong urls
skouliki
skouliki
Manager
Manager

Female Posts : 15029
Reputation : 1680
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Rotating Banner Issue

Post by Ape April 23rd 2017, 6:15 pm

Hello looking at your code there is lots of problems with missing codes
you need to re install it using this
https://help.forumotion.com/t138806-randomize-your-forum-banner

if you look at your code you have things missing


Rotating Banner Issue Left1212Rotating Banner Issue Center11Rotating Banner Issue Right112
Rotating Banner Issue Ape_b110
Rotating Banner Issue Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19075
Reputation : 1988
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Rotating Banner Issue

Post by itachi uchiha April 25th 2017, 5:46 pm

There is nothing missing with the codes. They are the exact same. The only thing different is I am using 2 banners and that code is using 6 hence why they have more urls than me. There is nothing wrong with my code, it just stopped working randomly on forumotions just like a lot of my other javascripts on my site?
itachi uchiha
itachi uchiha
Forumember

Male Posts : 146
Reputation : 1
Language : English
Location : New Zealand

http://www.narutonexusrp.com/forum

Back to top Go down

Solved Re: Rotating Banner Issue

Post by Ape April 25th 2017, 6:03 pm

yes i see the problem you do have parts missing look at your code here
       
Code:
$(function() {


          var banners = [

            'http://i38.servimg.com/u/f38/18/21/60/73/b010.png',
            'http://orig11.deviantart.net/ada6/f/2017/094/7/d/nn_by_satoace-db4mn24.png'

          logo = document.getElementById('i_logo') || document.getElementById('logo') || document.getElementById('pun-logo');


          if (logo) (logo.tagName == 'IMG' ? logo : logo.firstChild).src = banners[Math.floor(Math.random() * banners.length)];


        });

see your code is all ok until you get under your URL's
then you have this part missing

Code:
],
  if you look your code should be something like this


Code:
 $(function() {
          var banners = [
            'http://i38.servimg.com/u/f38/18/21/60/73/b010.png',
    'http://orig11.deviantart.net/ada6/f/2017/094/7/d/nn_by_satoace-db4mn24.png'
          ],
       
          logo = document.getElementById('i_logo') || document.getElementById('logo') || document.getElementById('pun-logo');
          if (logo) (logo.tagName == 'IMG' ? logo : logo.firstChild).src = banners[Math.floor(Math.random() * banners.length)];
        });



Rotating Banner Issue Left1212Rotating Banner Issue Center11Rotating Banner Issue Right112
Rotating Banner Issue Ape_b110
Rotating Banner Issue Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19075
Reputation : 1988
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Rotating Banner Issue

Post by itachi uchiha April 27th 2017, 8:45 am

It seems to be randomly working now. Thank you for your time.
itachi uchiha
itachi uchiha
Forumember

Male Posts : 146
Reputation : 1
Language : English
Location : New Zealand

http://www.narutonexusrp.com/forum

Back to top Go down

Solved Re: Rotating Banner Issue

Post by Ape April 27th 2017, 12:52 pm

Problem solved & topic archived.
Please read our forum rules: ESF General Rules


Rotating Banner Issue Left1212Rotating Banner Issue Center11Rotating Banner Issue Right112
Rotating Banner Issue Ape_b110
Rotating Banner Issue Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19075
Reputation : 1988
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum