Search Results

Search found 3 results on 1 pages for 'iamtheratio'.

Page 1/1 | 1 

  • jQuery - addClass or removeClass - Is there an append class?

    - by iamtheratio
    I have css hover over images for my tabs and I'm trying to get the class to change from .how to .how_on when I click on the image HOW. My tabs are HOW | WHAT | WHEN | WHO | WHY I have classes for each (.how, .how_on), (.what, .what_on), etc... Can I make jQuery add _on to the original class name using click(function(){}); ? HTML: <div id="tab_container"> <ul class="tabs"> <li><a class="how_on" href="#how">How</a></li> <li><a class="why" href="#why">Why</a></li> <li><a class="what" href="#what">What</a></li> <li><a class="who" href="#who">Who</a></li> <li><a class="when" href="#when">When</a></li> </ul> <p><img src="images/tab_top.jpg" width="864px" height="6px" alt="" border="0" /></p> </div> <div class="tab_body"> <!-- HOW --> <div id="how" class="tab"> <strong>HOW IT WORKS:</strong> </div> JQUERY: <script type="text/javascript"> jQuery(document).ready(function(){ //if this is not the first tab, hide it jQuery(".tab:not(:first)").hide(); //to fix u know who jQuery(".tab:first").show(); //when we click one of the tabs jQuery(".tabs a").click(function(){ //get the ID of the element we need to show stringref = jQuery(this).attr("href").split('#')[1]; // adjust css on tabs to show active tab //hide the tabs that doesn't match the ID jQuery('.tab:not(#'+stringref+')').hide(); //fix if (jQuery.browser.msie && jQuery.browser.version.substr(0,3) == "6.0") { jQuery('.tab#' + stringref).show(); } else //display our tab fading it in jQuery('.tab#' + stringref).fadeIn(); //stay with me return false; }); }); </script>

    Read the article

  • jQuery - How to animate click function without clicking (Slide-show like) - Is this possible?

    - by iamtheratio
    Hello, I have created a jQuery script (with help) that works great however I need it to automate/animate itself without using the click function, I just want to know is this possible and if so, how? Similar to a slide-show. Basically the code allows me to click on an image and hide/show a DIV, while changing a list of elements such as class/id name. Here's my code: JQUERY: jQuery(document).ready(function(){ //if this is not the first tab, hide it jQuery(".imgs:not(:first)").hide(); //to fix u know who jQuery(".imgs:first").show(); //when we click one of the tabs jQuery(".img_selection a").click(function(){ //get the ID of the element we need to show stringref = jQuery(this).attr("href").split('#')[1]; // adjust css on tabs to show active tab $('.img_selection a').removeAttr('id'); // remove all ids $(this).attr('id', this.className + "_on") // create class+_on as this id. //hide the tabs that doesn't match the ID jQuery('.imgs:not(#'+stringref+')').hide(); //fix if (jQuery.browser.msie && jQuery.browser.version.substr(0,3) == "6.0") { jQuery('.imgs#' + stringref).show(); } else //display our tab fading it in jQuery('.imgs#' + stringref).show(); //stay with me return false; }); });

    Read the article

  • jQuery - Need help stopping animation on click command.

    - by iamtheratio
    With a few of your help I was able to get the jquery I wanted to work flawlessly, except for one thing.. the animation doesn't stop when i click on the buttons. Scenario: I have an Image, and 3 buttons underneath labeled "1","2", and "3". The jquery will automate the click function every 4500ms and switch from 1 to 2, then 2 to 3 and continuously loop. However the problem is, if I manually click on a 1,2,3 button the animation does not stop. Any ideas how I could accomplish this? jQuery: var tabs; var len; var index = 1; var robot; function automate() { tabs.eq((index%len)).trigger('click'); index++; } robot = setInterval(automate, 5500); jQuery(document).ready(function(){ jQuery(".imgs").hide(); jQuery(".img_selection a").click(function(){ stringref = this.href.split('#')[1]; $(".img_selection a[id$=_on]").removeAttr('id'); this.id = this.className + "_on"; jQuery('.imgs').hide(); if (jQuery.browser.msie && jQuery.browser.version.substr(0,3) == "6.0") { jQuery('.imgs#' + stringref).show(); } else jQuery('.imgs#' + stringref).fadeIn(); return false; }); $('.img_selection a').removeAttr('id').eq(0).trigger('click'); tabs = jQuery(".img_selection a"); len = tabs.size(); }); I tried adding the below code, with a lot of help from this website, but to no avail.. CODE: jQuery(document).ready(function(){ jQuery(".imgs").hide().click(function(){ clearInterval(robot); }); HTML: <!-- TOP IMAGE ROTATION --> <div id="upper_image"> <div id="img1" class="imgs"> <p><img src="images/top_image.jpg" width="900" height="250" alt="The Ratio - Print Projects!" border="0" /></p> </div> <div id="img2" class="imgs"> <p><img src="images/top_image2.jpg" width="900" height="250" alt="The Ratio - In The Works!" border="0" /></p> </div> <div id="img3" class="imgs"> <p><img src="images/top_image3.jpg" width="900" height="250" alt="The Ratio!" border="0" /></p> </div> </div> <!-- / TOP IMAGE ROTATION --> <!-- TOP IMAGE SELECTION --> <ul class="img_selection"> <li><a id="img1_on" class="img1" href="#img1">1</a></li> <li><a class="img2" href="#img2">2</a></li> <li><a class="img3" href="#img3">3</a></li> </ul> <!-- / TOP IMAGE SELECTION -->

    Read the article

1