0

I am using sliphover.js a jquery for direction aware hover effect. When the page is loaded, the hover effect only work when F12 is clicked or inpect element is activated in chrome and IE10. Once the developer mode is activated or already activated developer mode is closed then it starts working till the page is reloaded again. i am using a number of jquery plugins as follows.

<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/jquery.sliphover.js"></script>
<script src="js/superfish.js"></script>
<script type="text/javascript" src="js/jquery.mmenu.js"></script>
<script src="js/jquery.singlePageNav.min.js"></script>
<script src="js/modernizr.min.js"></script>
<script src="js/jquery.flexslider.js"></script>
<script src="js/jquery.imagesloaded.js"></script>
<script src="js/custom.js"></script>

I am including custom.js code

$(function(){
    $("#tiles").sliphover();
    });

My html, i am also using wookmark plugin to make a gallery

<div id="main" role="main">
                <ul id="tiles">
                    <!--
                      These are our grid items. Notice how each one has classes assigned that
                      are used for filtering. The classes match the "data-filter" properties above.
                      -->
                    <li data-filter-class='["london", "art"]' class="hello">
                      <img src="images/gallery-image1.jpg" title="<a href='http://google.com'>Loyal Cao</a>" >
                    </li>
                    <li data-filter-class='["london", "art", "sport"]' class="hello">
                      <img src="images/gallery-image2.jpg" >
                    </li>
                    <li data-filter-class='["london", "art", "paris"]' class="hello">
                      <img src="images/gallery-image3.jpg" >
                    </li>
                    <li data-filter-class='["london", "art", "paris"]' class="hello">
                      <img src="images/gallery-image4.jpg" >
                    </li>
                    <li data-filter-class='["london", "sport"]' class="hello">
                      <img src="images/gallery-image5.jpg" >
                    </li>
                    <li data-filter-class='["london", "art", "sport"]' class="hello">
                      <img src="images/gallery-image6.jpg" >
                    </li>
                    <li data-filter-class='["london", "paris"]' class="hello">
                      <img src="images/gallery-image7.jpg" >
                    </li>
                    <li data-filter-class='["london", "art", "paris"]' class="hello">
                      <img src="images/gallery-image8.jpg" >
                    </li>
                    <!-- End of grid blocks -->
                </ul>
            </div>

please help me solve this issue.

user2339174
  • 3
  • 1
  • 4
  • Inclued your custom.js file bottom of the page before body tag closed. – Rakesh Kumar Feb 17 '14 at 06:14
  • No change, the problem still exist. I still have to **activate developer mode** to make jquery plugin work. Thanks for your response. – user2339174 Feb 17 '14 at 06:49
  • @RakeshKumar - I think he shouldn't need to do this because he wrapped his code into jQuery's `document.ready` equivalent `$(function(){}` – Raphael Müller Feb 17 '14 at 06:49
  • @raphael you are right but $(function()())(); this works only if you put this in bottom of the page before body tag close. – Rakesh Kumar Feb 17 '14 at 06:54
  • @RakeshKumar the purpose of [document.ready](http://api.jquery.com/ready/) is to execute code after the DOM is ready. It should work even when the javascript is included at the bottom of the page. – Raphael Müller Feb 17 '14 at 06:59
  • @user2339174, I could imagine that the problem lies in the HTML you did not provide to us (_the rest of the needed structure for a valid HTML document_). Could you provide us the whole document? – Raphael Müller Feb 17 '14 at 07:02
  • @raphael: dear document.ready is correct but $(function(){}) is shorthand of document.ready. We called it self excitable function. Purpose of using this..read Protecting the $ Alias and Adding Scope(http://learn.jquery.com/plugins/basic-plugin-creation/) – Rakesh Kumar Feb 17 '14 at 07:04
  • @user2339174 you may want to have a look at [this post](http://stackoverflow.com/questions/7742781/why-javascript-only-works-after-opening-developer-tools-in-ie-once) which describes a quite similar problem. – Raphael Müller Feb 17 '14 at 07:06
  • http://pankajk1018.s55.us/startpoint/ You can check out the Gallery and portfolio section here in you chrome and ie browser. I have uploaded the files for you. You need to press the F12 button for hover effect to work and that is the main problem. Thank you raphael and rakesh for involvment in the discussion. – user2339174 Feb 17 '14 at 07:21

1 Answers1

0

Hi @user2339174 I'm the author of the sliphover plugin. I don't know if I got what you mean but a few days ago I received a support request on the sliphover github project issue page, who also got the problem when using wookmark with sliphover and I fixed that. Please download the latest version of sliphover (v1.1.1) and try if your problem solved.

牛さん
  • 2,884
  • 3
  • 29
  • 43
  • hello wayou I am the same person who posted the issue to your github project. The issue was resolved with your update but i got this issue and i thought it may not be related to your plugin. I am using the latest sliphover plugin. I don't know if the issue is related to this plugin or something else. Please check it and let me know. I will be thankful to you. and thanks again you for your great support. – user2339174 Feb 17 '14 at 09:33
  • here is the link of project i am working on pankajk1018.s55.us/startpoint – user2339174 Feb 17 '14 at 09:39
  • @user2339174 I have checked you page and the source. Don't know if this help but please try call the sliphover after the wookmark stuff. – 牛さん Feb 17 '14 at 11:35
  • I've tested and it seems fixed. It has something to do with you other plugins or animation on the elements.So just let the sliphover execut at the end of all your custom code, especially after the wookmark – 牛さん Feb 17 '14 at 11:50