Custom jQuery Field

Posted in: Newspaper
Post count: 80

Hello TagDiv,

There seems to be an issue with the JavaScript field in the Custom CSS panel.

Developer has added jQuery in Custom JavaScript field and it is showing up on website View Source, but not working. jQuery is correct.

This is the jquery in question:
$(document).ready(function(){
//var wid = $(“body”).width();
//var wrapwid = $(“#td-outer-wrap”).width();
// var newwid = wid – wrapwid;
$(“.td-banner-wrap-full”).css({“margin-left”: “20px”});
});

Will you be able to let me know why?

Post count: 23312

Hello Glitched,

I have tested on my side your code provided and seems to have some errors in console with it. Please try to use the code below and check the results.

jQuery(document).ready(function(){
//var wid = $("body").width();
//var wrapwid = $("#td-outer-wrap").width();
// var newwid = wid – wrapwid;
jQuery(".td-banner-wrap-full").css({"margin-left": "20px"});
});

In future, for more references in this regard, please check this topic here -> http://stackoverflow.com/questions/3931529/is-not-a-function-jquery-error

Thanks.

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.