javascript - jQuery script does not load in Tumblr theme -
I wanted to use Jquery script for my tumblr theme but it does not work.
This is my code:
& lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Script src = "// ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> & Lt; Script src = "http://static.tumblr.com/wgijwsy/jgemkyt9x/jquery.photoset-grid.min.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; $ ('Photoset Grid') photosetGrid () .; & Lt; / Script & gt; {Block: post} {block: photos} & lt; Div class = "photoset" & gt; & Lt; Div class = "photoset-grid" data-layout = "{PhotosetLayout}" & gt; {Block: photos} & lt; Img src = "{photoURL-500}" {block: caption} alt = "{caption}" {/ block: caption} / & gt; {/ Block: photos} & lt; / Div & gt; {Block: caption} {caption} {/ block: caption} & lt; / Div & gt; {/ Block: photos} {/ block: post} & lt; / Body & gt; & Lt; / Html & gt;
It was originally pasted from this site:
But that does not work, the script does not load, I think. Maybe I put those script tags in the wrong place?
Just told Charlie you're starting a new one).
The way you wrote just now, your code says: "Find all the elements that have photoset-grid
class, and with them photosetGrid () < / Code> function. "The problem is that when this line of code runs, not any element with the browser address
photoset-grid
class - in fact, It does not know about the elements of any body, because the browser has not yet taken them while reading the page.
(Your code does not return the error, however, because it says "
.photoset-grid
elements all And if it is not even any element of that type, because it can still do all of the operations on zero.)
Its Instead, what's the last set of your & lt; script & gt; & lt; / script & gt;
tags,
$ (document) .ready (Function () {$ (photoset-grid)) photosetGrid ();});
What it says: "When you load and set up in the page structure, find and delete all .photoset-grid
elements photosetGrid ()
Work with "
Comments
Post a Comment