Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Script not loading quick enough



11:03 am on Apr 26, 2013 (gmt 0)

5+ Year Member

I have a custom built Wordpress site where I have the following custom script that loads after jQuery

$(document).ready(function() {
$(".p-list li:nth-child(odd)").addClass('odd');
$(".p-list.cat li:nth-child(6n+1),li:nth-child(6n+2),li:nth-child(6n+3)").addClass('oddrow');
$('.slider').css('display', 'block');

$(document).ready(function() {
$(".p-list .details").dotdotdot({
$(".p-list-m .details").dotdotdot({
after: ".more"

$('ul.sub-menu').addClass (function(idx) {
return "item-" + idx;

The problem is when the page loads I get a flash of the styling before the CSS classes have been added and so it moves the design slightly.

Any ideas or help with this would be really appreciated as it's driving me nuts!

Thanks in advance.

Featured Threads

Hot Threads This Week

Hot Threads This Month