javascript - Show/hide and slider conflict -


a few days ago asked question regarding show/hide div script had problems with.

js show/hide default behavior

tested solutions , nothing seemed work on website (they work in fiddles or different areas of website 1 need in). problem inside show/hide divs have slider. there 4 tabs, each showing different slider. best guess problem appears because both slider , show/hide use same display:none, altering slider's content.

here's js have show/hide:

window.addeventlistener("hashchange", function () {     var targetdiv = $(location.hash);     if (!targetdiv.is(':visible')) {         $('.page1').slideup();         targetdiv.slidedown();     } else {         $('.page1').slideup();     } }, false); 

the slider use called flickity , it's link is; https://cdnjs.cloudflare.com/ajax/libs/flickity/1.1.0/flickity.pkgd.js

the link of live website is: http://theworkshop.ro/astra3/

here's fiddle of show/hide: http://jsfiddle.net/s9cxjrmf/ (currently .page css commented show 4 show sliders, if add display none in fiddle doesn't work anymore, shows arrows of slider, not it's content)

the problem in work section of website.

i'm struggling few days, idea how solve problem?

try code hide div inside #work_box , again displays first 1 way script running hiding , showing div work hope you.

  $( document ).ready(function() {         $( "#work_box div" ).each(function() {            $( ).css( "display", "none" );         });          $( "#work_box div" ).first().css( "display", "block" );          $('#work_box div').first().find(':hidden').each(function(){            $(this).show();         });     }); 

this working first div need repeat this.

$('#work_box div').first().find(':hidden').each(function(){     $(this).show(); }); 

for other div when user click on other links films,tv_shows etc.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -