21294 Posts in 5734 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2219 Views |
-
can't make jquery pop up work

19 March 2010 at 7:16am
Hello,
I have a VideoHolder page type with a bunch of links to flash videos. I want each link to a video to open in a popup window. I am trying to use the jquery found here. I can't make this code work... I either get errors in the jQuery or the page just opens normally. I have added the proper class to the a tag for the link, and have included the javascript in the VideoHolder page type.
I think what is not connecting for me is how to include the script given in demo1 code example along with the entire file properly in SS. Any guidance much appreciated!
-
Re: can't make jquery pop up work

19 March 2010 at 3:12pm
Hi theoldlr,
you can add a js file like this (in VideoHolder controller)
public function init(){
parent::init();
Requirements::javascript('path/to/jquery.popupWindow.js');
}hope it helps.
cheers
Carlos -
Re: can't make jquery pop up work

20 March 2010 at 4:49am
Carlos,
I have included the code to require the javascript file in the videoholder as you described. However, if you look at the example1 demo code:
<p><a href="http://www.yahoo.com" title="yahoo.com" class="example1demo">open popup</a></p>
<script type="text/javascript">
$('.example1demo').popupWindow({
height:500,
width:800,
top:50,
left:50
});
</script>Can i include the short jQuery statement that tells the script which class is supposed to popup into the jquery.popupWindow.js ? This is what I am not sure how to do.
Thanks
-
Re: can't make jquery pop up work

20 March 2010 at 9:17am
I got it to work... just needed to add this to the beginning of the .js file:
jQuery(document).ready(function(){
jQuery('.videoLink').popupWindow();
});So much easier than I thought.
| 2219 Views | ||
|
Page:
1
|
Go to Top |


