Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery .animate() with color plugin transitions flicker in Firefox
    primarykey
    data
    text
    <p>I'm trying to create a menu, which, upon item click, changes the link to text (removes hyper-linking functionality from selected item) and changes the color smoothly from "general link" to "selected" color. My code works everywhere, except newer versions of Firefox. FF causes the transitions to flicker.</p> <p>My menu is created dynamically upon page load. A function called "createInitial()" is responsible for this action:</p> <pre><code> function createInitial(){ // BLA-BLA-BLA SOME CODE //construct menu for(i=0; i&lt;pages.length; i++){ //for every item of pages[] array $dashLink = $("&lt;a&gt;"); $dashLink.html(pages[i].title); $dashLink.attr("href", "javascript:void(0)"); $dashLink.attr("id", "dashLink" + i); //create a link for a particular page (with matching ID field) $dashLink.click(menuHandler); $dashText = $("&lt;span&gt;"); $dashText.html(pages[i].title); $dashText.attr("id", "dashText" + i); //create a text (to be used instead of a link, while on a page) for a particular page $dashText.css("display", "none"); $("#menu").append("[ ", $dashLink, $dashText, " ] "); //add links and texts to same bracket space in the menu } // //creates default text instead of a link $("#dashLink" + currentPage).css("display", "none"); $("#dashText" + currentPage).css("display", "inline"); // // BLA-BLA-BLA SOME CODE } </code></pre> <p>This function is only executed once - upon page load. After that, the function "changeHeading()" is responsible for changing all the items in the menu:</p> <pre><code> function changeHeader(page){ //change a page //stop all previous animation $("#heading").stop(); $("#content").stop() $("#menu a").stop(true); $("#menu span").stop(true); // //change current page to new, store current page id tempPage = currentPage; currentPage = page; // //record current changing menu items color state currentPageLinkTextColor = $("#dashText" + tempPage).css("color"); // starting point for current page menu text item nextPageLinkColor = $("#dashLink" + page).css("color"); //starting point for clicked page menu link item // //show current page menu item as link and start chaging to link color $("#dashLink" + tempPage).css("color", currentPageLinkTextColor); $("#dashText" + tempPage).hide(); $("#dashLink" + tempPage).show(); $("#dashLink" + tempPage).animate({color: linkColor}, transitionTime*2); // //show next page menu item as text and start changing to text color $("#dashText" + page).css("color", nextPageLinkColor); $("#dashLink" + page).hide(); $("#dashText" + page).show(); $("#dashText" + page).animate({color: linkTextColor}, transitionTime*2); // $("#menu a").animate({color: linkColor}, transitionTime*2); //change all menu links to link color //changes title $("#heading").fadeOut(transitionTime, function() { //fade out / fade in title $("#heading").html(pages[page].title) $("#heading").fadeIn(transitionTime) }); // } </code></pre> <p>This code works perfectly everywhere (even in IE), except for the newer versions of Firefox (not sure, but maybe only on Windows). I've tested Firefox 12 on Linux Mint and it works like a charm. However, when testing with Firefox 15 on Windows - the transitions flicker badly! I found several threads, where people are having similar problems, but most of them are too old for FF15. Here are a couple links I've tried: - <a href="https://stackoverflow.com/questions/2897162/jquery-slidedown-flickering-in-firefox">jQuery SlideDown Flickering in Firefox</a> - <a href="https://stackoverflow.com/questions/2183508/jquery-animate-height-causes-background-image-flickering-in-firefox">jquery animate (height) causes background-image flickering in firefox</a> - <a href="http://voidcast.wordpress.com/2011/03/29/jquery-flicker-problem-on-firefox-with-fadeout-and-fadein/" rel="nofollow noreferrer">http://voidcast.wordpress.com/2011/03/29/jquery-flicker-problem-on-firefox-with-fadeout-and-fadein/</a></p> <p>Nothing helped...unfortunately. Does anyone have an idea what might be the problem? Thanks!</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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