3318 Posts in 890 Topics by 835 members
|Go to End|
29 December 2009 at 8:40pm
Hello, I hope someone can help me with this one.
I am trying to add a temporary auto pop up window on my homepage, however pasting my .js script on the html editor doesn't seem to work.
I have added my script to my Page.ss file but now my pop up window comes up everytime any page loads.
Is there a way I can tell my pop up window to load only when my home page is loaded?
Thank you in advance and Happy New Year everyone!
3 January 2010 at 7:39am
Wrap your js in a if Title==Home block (or whatever your homepage is called)
11 January 2010 at 1:48pm
Hello Zenmonkey, thanks for your reply, unfortunately I'm not sure I understand. I don't know much about js =$
Could you explain a bit more? thanks again.
12 January 2010 at 3:01am
<% if Title==Home %>
Script Goes Here
<% end_if %>
That way it will only load the script on a page whose title is Home
12 January 2010 at 10:11am
It would be much better to use the Class of the page in the if statement as then you will include it on all the pages of that type AND you will be able to have your users change the title of the page and it will still work.
<% if ClassName = HomePage %>
alert('this is the home page');
<% end_if %>
|Go to Top|