Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery hover does not work after getting cookie value
    primarykey
    data
    text
    <p>I have an item list with a view switcher for list view, gallery and grid.</p> <pre><code>&lt;div class="theView"&gt; &lt;div class="galS active" id="gal"&gt;&lt;span&gt;&lt;img src="layout/cyt/img/blank.gif"&gt;&lt;/span&gt;Galerie&lt;/div&gt; &lt;div class="mosS" id="mos"&gt;&lt;span&gt;&lt;img src="layout/cyt/img/blank.gif"&gt;&lt;/span&gt;Mosaik&lt;/div&gt; &lt;div class="listS" id="list"&gt;&lt;span&gt;&lt;img src="layout/cyt/img/blank.gif"&gt;&lt;/span&gt;Liste&lt;/div&gt; &lt;/div&gt; &lt;div id="itemcontainer"&gt; &lt;div class="con"&gt; &lt;div class="item_page_item list"&gt; //list,mos,gal &lt;div class="item sale"&gt;&lt;span class="number"&gt;1&lt;/span&gt; &lt;div class="pos"&gt; &lt;div class="inner"&gt; &lt;div class="itemImg Img123"&gt;&lt;/div&gt; ... &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I save the values when changing the view into a cookie, for each of them:</p> <pre><code>$("#gal").click(function() { $("#gal").addClass("active"); $("#list").removeClass("active"); $("#mos").removeClass("active"); $(".item_page_item").fadeOut(200, function() { $.cookie("theView", "g", { expires: 7, path: "/" }); $(this).removeClass("list"); $(this).removeClass("mos"); $(this).addClass("gal").fadeIn(200); }); return false; }); </code></pre> <p>When having the list view opened first and changing to grid or gallery, the hover pane with integrated carousel is not opening, at all other cases everything wokrs fine.</p> <p>Here is the code for the hover function:</p> <pre><code> $(".item_page_item.mos").hover(function(){ $(this).find(".pane").stop(true, true).fadeIn(); $("#paneImg",this).carouFredSel({ responsive: true, circular: false, auto: false, items: { visible: 1, width: 299, height: 241 }, scroll: { fx: 'directscroll' } }); $("#paneThumb",this).carouFredSel({ responsive: true, circular: false, infinite: false, auto: false, prev: '#prev', next: '#next', items: { visible: { min: 2, max: 5 }, width: 51, height: 42 } }); $('#paneThumb a',this).click(function() { $('#paneImg').trigger('slideTo', '#' + this.href.split('#').pop() ); $('#paneThumb a').removeClass('selected'); $(this).addClass('selected'); return false; }); },function(){ $(this).find(".pane").stop(true, true).fadeOut(200, function() { $("#paneImg",this).trigger("destroy", true); }); }); </code></pre> <p>When hovering, an overlay fades over the item with a carousel (caroFredsel).</p> <p>The only problem is, that it is not working when i have the list view saved in the cookie, open the page with this view and change to one of the others.</p> <p>hope you can help me, i'm going crazy.</p> <p>The function for reading the cookie value:</p> <pre><code>$(function() { var cc = $.cookie("theView"); if (cc == "g") { $(".item_page_item").removeClass("list"); $(".item_page_item").removeClass("mos"); $(".item_page_item").addClass("gal"); $("#gal").addClass("active"); $("#list").removeClass("active"); $("#mos").removeClass("active"); } else if (cc == "m") { $(".item_page_item").removeClass("gal"); $(".item_page_item").removeClass("list"); $(".item_page_item").addClass("mos"); $("#mos").addClass("active"); $("#gal").removeClass("active"); $("#list").removeClass("active"); } else if (cc == "l") { $(".item_page_item").removeClass("gal"); $(".item_page_item").removeClass("mos"); $(".item_page_item").addClass("list"); $("#list").addClass("active"); $("#gal").removeClass("active"); $("#mos").removeClass("active"); } }); </code></pre>
    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.
    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