jQuery masonry plugin - Have trouble getting the d

2019-08-20 17:08发布

I have a problem with the Masonry plugin to jQuery.

If you take a look at this link: http://iloveinternet.org/kunder/omk/ and scrolls down to the brown field with a pink line on top. Can you see the div boxes there? They are supposed to be stacked next to eachother in rows of three with the masonry plugin. This works fine in most browsers except from IE7 in windows XP in parallels on my mac.

Does anyone know what I´m doing wrong? Is it bad html kode or is it something in the script?

By the why... if you could check if you experience the same problem in IE or not, it would be great to know.

  • Thank you :)

1条回答
Root(大扎)
2楼-- · 2019-08-20 18:04

Your script is causing an error for me on line 36 in index.php where document.location.hash is an empty string. Not sure that this will fix the column issue but better begin with a working page before trying to debug layout/css issues.

var destination = $( document.location.hash ).offset().top;

Try something like this:

var $el = $( document.location.hash );
var destination = 0;

if ( $el.length ) {
   destination = $el.offset().top;
} 

$("html:not(:animated),body:not(:animated)").scrollTop( destination );
查看更多
登录 后发表回答