0
votes

Im using the jQuery noConflict method here: http://drupal.org/node/1058168

Now, both of the following work:

$jq("document").ready(function(){
    alert('alert');
});

$("document").ready(function(){
    alert('alert');
});

However this does work:

$("document").ready(function(){
    $(".view-product-slideshow .pager-num-1 img").css("display","none");
});

But this does not:

$jq("document").ready(function(){
    $jq(".view-product-slideshow .pager-num-1 img").css("display","none");
});

Ive used the noConflict method once before and it worked fine. Ive no idea why it would work for the alert but not the CSS change.

My site is here: http://smartpeopletalkfast.co.uk/pp4/shop/baby-essentials/sleepsuit-plush

Thanks

UPDATE - Ive now removed the extra code from script.js so all thats there is:

//Hide thumnail on product page thats being used as main image 
$jq("document").ready(function(){
    $jq(".view-product-slideshow .pager-num-1 img").css("display","none");
});
3
I think its better to use hide(0) and show(0). maybe it will also fix your problem - yoavmatchulsky
@yoavmatchulsky changing it (on my local computer) hasn't fixed it. Your probably right about it being a better solution but its not causing this problem so ill think about it when ive sorted this bug. Thanks - Evanss

3 Answers

0
votes

your error is on line 61 of ur script.js:

Uncaught TypeError: Object # has no method 'smoothDivScroll'

also in that file u should have everything wrapped in the .ready() not every individual thing

0
votes

Turns out the element I was trying to target with jQuery was itself generated by javascript. Changing my document.ready to window.load fixed this.

0
votes

When using the noconflict mode of jQuery, you should use this:

jQuery(document).ready(function($){
    $(".view-product-slideshow .pager-num-1 img").css("display","none");
});

jQuery is the new $ and you can pass jQuery as $ to your function().

Also, it's document and not "document"