1

I have a script which is a slide-up hover effect, it only loads though when you refresh the page for some reason. This is really annoying...

I think it could be to do with me calling it in the html as a script:

jQuery(function ($) {
    $('.bb-slide-cap').mosaic({
        animation: 'slide', //fade or slide
        speed: 600,
        preload: 1
    });

});

Fiddle: http://jsfiddle.net/JJDn7/3/

7
  • It doesn't do anything for me even after refreshing the page (Chrome). Commented Jun 27, 2014 at 10:23
  • I wonder if the $ in jQuery(function ($) { is giving you fits. Try it without jQuery(function () {. And in the JSFiddle I changed it to run in <head> rather than onLoad. Commented Jun 27, 2014 at 10:24
  • 1
    @bloodyKnuckles That's the correct way to write it. You use this syntax if you have another library loaded that uses $. This allows you to use the $ shorthand as a local variable inside the body of the code. Commented Jun 27, 2014 at 10:27
  • 1
    jsfiddle.net/devmgs/JJDn7/8/embedded/result Is this you neeed Commented Jun 27, 2014 at 10:29
  • if you are using mosaic plugin , go through this github.com/buildinternet/mosaic/blob/master/examples.html Commented Jun 27, 2014 at 10:39

1 Answer 1

2

I doesnt matter but in case of two scripts sharing $ i thought i wrap in head. If its working for you real challenge then its good give it a try in your real challenge.

The link for other readers if it solves your issue.

jQuery(function ($) {
    $('.bb-slide-cap').mosaic({
        animation: 'slide', //fade or slide
        speed: 600,
        preload: 1
    });

});

DEMO

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.