How to add my own pop up dialog box with some jquery code
Permalink
I want to add some of popup image gallery with using my own coding without adding an addon. So I added my jquery imports sperately in header file. But didn't work.I Added Like this in header file,
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo $this->getThemePath(); ?>/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $this->getThemePath(); ?>/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript" src="<?php echo $this->getThemePath(); ?>/fancybox/video.js"></script>
But I it didnt work.
What is the solution. Please give me a help.
In other way,
I want to add this fancy box gallery without using an addon
http://fancybox.net/
How can I do that?
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo $this->getThemePath(); ?>/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $this->getThemePath(); ?>/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript" src="<?php echo $this->getThemePath(); ?>/fancybox/video.js"></script>
But I it didnt work.
What is the solution. Please give me a help.
In other way,
I want to add this fancy box gallery without using an addon
http://fancybox.net/
How can I do that?
The second thing is to ensure that the code you have is placed after the line <?php Loader::element('header_required'); ?>
The third thing is to ensure that you have the fancybox files placed in the correct folder. I'd assume that there will be a bunch of images to go with it, and you might have to update the paths to those images within the css file.
Your code within the HEAD section of your theme should look like this:
Once you have got everything in the right place, the fourth thing is to use JQuery to add the click event to fire up the fancybox when clicking on something. I would use a class called fancybox to keep it simple.
So, add this to your HEAD section (beneath the code above):
Then add the fancybox class to links from your small images to your large images, something like this:
Remember also that the fancybox won't work until your page has completely finished loading.