Note that there are some explanatory texts on larger screens.

plurals
  1. POImplementing pre-made rotating banner into website
    primarykey
    data
    text
    <p>I'm trying to implement the rotating jQuery banner found here: <a href="http://visitmix.com/labs/glimmer/samples/sequence.html" rel="nofollow">http://visitmix.com/labs/glimmer/samples/sequence.html</a></p> <p>onto my site. All of the code is laid out, and you'd think it would be idiot proof, but I don't have a firm grasp on how to connect languages to one another.</p> <p>I'm pretty good now with PHP, CSS and HTML but javaSCRIPT and me just don't seem to click.</p> <p>I copied the HTML over into my file at the appropriate location, copied the CSS, and copied the function into my js/scripts.js file.</p> <p>This is what my scripts.js file looks like:</p> <pre><code>var site = function() { this.navLi = $('#nav li').children('ul').hide().end(); this.init(); }; site.prototype = { init : function() { this.setMenu(); }, // Enables the slidedown menu, and adds support for IE6 setMenu : function() { $.each(this.navLi, function() { if ( $(this).children('ul')[0] ) { $(this) .append('&lt;span /&gt;') .children('span') .addClass('hasChildren') } }); this.navLi.hover(function() { // mouseover $(this).find('&gt; ul').stop(true, true).slideDown('slow', 'easeOutBounce'); }, function() { // mouseout $(this).find('&gt; ul').stop(true, true).hide(); }); } } new site(); jQuery(function($) { var timer; function button1_click(event) { $(".slide").css("visibility","hidden"); $("#image1").css("visibility","visible"); $("#image1").css("opacity","0"); $("#image1").animate({"opacity":1},300, "linear", null); $("ul.buttons li").removeClass("active"); $("#image1").animate({"opacity":1},300, "linear", null); $("#button1").addClass("active"); clearTimeout(timer); timer = setTimeout(eval("button2_click"),"3000"); $("#image1").animate({"opacity":1},300, "linear", null); } function button2_click(event) { $(".slide").css("visibility","hidden"); $("#image2").css("visibility","visible"); $("#image2").css("opacity","0"); $("#image2").animate({"opacity":1},300, "linear", null); $("ul.buttons li").removeClass("active"); $("#image2").animate({"opacity":1},300, "linear", null); $("#button2").addClass("active"); clearTimeout(timer); timer = setTimeout(eval("button3_click"),"3000"); $("#image2").animate({"opacity":1},300, "linear", null); } function button3_click(event) { $(".slide").css("visibility","hidden"); $("#image3").css("visibility","visible"); $("#image3").css("opacity","0"); $("#image3").animate({"opacity":1},300, "linear", null); $("ul.buttons li").removeClass("active"); $("#image3").animate({"opacity":1},300, "linear", null); $("#button3").addClass("active"); clearTimeout(timer); timer = setTimeout(eval("button1_click"),"3000"); $("#image3").animate({"opacity":1},300, "linear", null); } function OnLoad(event) { clearTimeout(timer); timer = setTimeout(eval("button2_click"),"3000"); } $('#button1').bind('click', button1_click); $('#button2').bind('click', button2_click); $('#button3').bind('click', button3_click); OnLoad(); }); </code></pre> <p>I thought I had connected my scripts.js file to my HTML file by writing</p> <pre><code>&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;script src="js/scripts.js"&gt;&lt;/script&gt; </code></pre> <p>But when the page is loaded, the buttons don't seem to rotate between the three images.</p> <p>Can somebody spot my error(s), or tell me how to go about doing this?</p> <p>EDIT: here is my CSS code for the portion that relates to the banner:</p> <pre><code>/* ROTATING BANNER CSS */ .slideshow { position:relative; padding:0; margin-left: 12.5%; margin-right: 12.5%; margin-bottom: 10px; border-radius: 8px; overflow: hidden; width: 1000px; height: 250px; } .slideshow a img { border:none; } .slideshow li.slide { list-style-type:none; } .slideshow .slides { height:260px; margin:0; } .slideshow .slides li.slide { visibility:hidden; position:absolute; left:0px; top:0; } .slideshow .buttons { display:none; } .slideshow .buttons { display:block; position:absolute; z-index:10; left:0px; bottom:20px; margin:0; } .slideshow .buttons li { float:left; display:inline; width:30px; height:30px; margin:0; padding-left:11px; line-height:30px; background-image:url('buttonBg.png'); background-repeat:no-repeat; } .slideshow .buttons li a { float:left; text-decoration:none; width:30px; height:30px; color:#fff; outline:0; } .slideshow ul.buttons li a:hover { text-decoration:none; color:#0a0a0a; } .slideshow ul.buttons li.active a:hover, .slideshow ul.buttons li.active a { color:#666666; } </code></pre> <p>Here is my HTML;</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type" /&gt; &lt;link rel="stylesheet" href="css/style.css" type="text/css" /&gt; &lt;link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,400italic,300italic' rel='stylesheet' type='text/css'&gt; &lt;title&gt;filler.com&lt;/title&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;script src="js/scripts.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body style="background-image: url('images/bg.jpg')"&gt; &lt;br /&gt; &lt;div class="slideshow"&gt; &lt;ul class="buttons"&gt; &lt;li class="active" id="button1"&gt;&lt;a href="#" title="warframebuilds"&gt;1&lt;/a&gt;&lt;/li&gt; &lt;li id="button2"&gt;&lt;a href="#" title="create build"&gt;2&lt;/a&gt;&lt;/li&gt; &lt;li id="button3"&gt;&lt;a href="#" title="forums"&gt;3&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;ul class="slides"&gt; &lt;li style="visibility:visible" class="slide" id="image1"&gt; &lt;a href="http://www.filler.com/"&gt;&lt;img alt="warframebuilds" src="images/bannerimg1.png" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class="slide" id="image2"&gt; &lt;a href="http://www.filler.com/create.php"&gt;&lt;img alt="create build" src="images/bannerimg2.png" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class="slide" id="image3"&gt; &lt;a href="http://www.filler.com/forums"&gt;&lt;img alt="forums" src="images/bannerimg3.png" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>Thanks so much!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload