Webmastersite.net
Register Log In

Latest version kills "Jquery Masonry"

Comments on Latest version kills "Jquery Masonry"

Orbitalz
Experienced

Usergroup: Customer
Joined: Dec 19, 2004

Total Topics: 15
Total Comments: 54
Posted Sep 28, 2009 - 6:46 PM:

I was using 5.0.71 I think it was, and I was using "Jquery Masonry" to auto adjust my posts layout. The latest version 5.1.3 causes it to stop working.

It supposed to look like Example A from the pic on this site: http://desandro.com/resources/jquery-masonry
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Sep 29, 2009 - 7:07 AM:

WSN 5.1 uses jquery itself, so you'll need to incorporate your jquery into WSN's. I believe there can only be one document ready function, that complicates things.

There are two pluggable functions in WSN which you can use:

function extrareadyfunctioncontent()
{ // additional javascript to place in jquery's document ready function
return '';
}

function extrajsheadercontent()
{ // additional javascript to place in the head area AFTER the jquery includes
return '';
}

Put the document ready code in the first one and any other jquery-dependent <head> code in the second.

This seems more complicated than it should be though, so I think I'll simplify with text files for 5.1.4... let's say a jquery/documentready.txt and jquery/morejavascript.txt where you can place the code directly. Documented in advance: scripts.webmastersite.net/w...nks/jquery_issues-529.html
Orbitalz
Experienced

Usergroup: Customer
Joined: Dec 19, 2004

Total Topics: 15
Total Comments: 54
Posted Sep 29, 2009 - 10:29 AM:

Im a little confused on what to add to which plugin. this is the code from my wrapper.tpl in the <head> section:



<script type="text/javascript" src="js/jquery.min.js"></script>

<script type="text/javascript" src="js/jquery.masonry.js"></script>


<script type="text/javascript">
$(function(){
//run masonry when page first loads
$('.wrap').masonry();

//run masonry when window is resized
$(window).resize(function() {
$('.wrap').masonry();
});

})
</script>
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Sep 29, 2009 - 5:37 PM:

5.1.4 is released within the next few minutes. Upgrade, then put

$('.wrap').masonry();

//run masonry when window is resized
$(window).resize(function() {
$('.wrap').masonry();

into jquery/documentready.txt

and

<script type="text/javascript" src="js/jquery.masonry.js"></script>

into jquery/morejavascript.txt
Orbitalz
Experienced

Usergroup: Customer
Joined: Dec 19, 2004

Total Topics: 15
Total Comments: 54
Posted Sep 30, 2009 - 10:11 AM:

ok, I did that. And it still doesn't work...

and also, Ive noticed that this new version (since 5.1.0) outputs my css file information into the site.

If you look at the sourcecode of my site, you can see it.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Sep 30, 2009 - 8:34 PM:

You've inserted
<script type="text/javascript" src="http://www.stylelogger.com/js/jquery.min.js"></script>
which gives you two jqueries. Don't load another jquery, WSN already has one.

and also, Ive noticed that this new version (since 5.1.0) outputs my css file information into the site.

As far as I can see, it only does that when you turn on the "Convert Stylesheets to Inline?" option at Admin Panel -> Miscellaneous -> Advanced Options to tell it to.
Orbitalz
Experienced

Usergroup: Customer
Joined: Dec 19, 2004

Total Topics: 15
Total Comments: 54
Posted Oct 01, 2009 - 10:14 AM:

oh yea, hehe. forgot I turned the "display inline" on. But it still doesn't work. I removed the jquery.min.js from the txt file...
Orbitalz
Experienced

Usergroup: Customer
Joined: Dec 19, 2004

Total Topics: 15
Total Comments: 54
Posted Oct 01, 2009 - 8:46 PM:

nevermind, I fixed it now. forgot a closing bracket in the documentready.txt file. thnx!
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Oct 01, 2009 - 9:00 PM:

You have
<script type="text/javascript" src="http://www.stylelogger.com/js/jquery.masonry.js"></script>
<script type="text/javascript" src="http://www.stylelogger.com/js/jquery.masonry.min.js"></script>
now, which double-includes masonry -- min.js is just a compressed version of .js I presume. May work but likely slows the browser.
Orbitalz
Experienced

Usergroup: Customer
Joined: Dec 19, 2004

Total Topics: 15
Total Comments: 54
#10 - Quote - Permalink
Posted Oct 04, 2009 - 11:44 AM:

ok thnx
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.