21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1140 Views |
-
javascript not working in page

21 January 2010 at 11:27am Last edited: 21 January 2010 11:28am
Hello
I am trying to add RevealingPhotoSlide in my page,I have 2 js file and one css file and few images,i have saved the css file under themes/template/blackcandy/css and images under themes/template/blackcandy/images ,I need to include the js file in my page and html code in my page,this is how i am doing it.
i have added the below code in my page.php filepublic function init() {
parent::init();Requirements::themedCSS("layout");
Requirements::themedCSS("typography");
Requirements::themedCSS("form");// my added line
Requirements::themedCSS("style");
Requirements::javascript('mysite/javascript/jquery.js');
Requirements::javascript('mysite/javascript/photorevealer.js');
//adding ended here
}
in Page.ss just under the layour div i have added the below lines
<div id="page-wrap">
<h1>Revealing Photo Slider</h1>
<table><tr>
<td><div class="photo_slider">
<img src="http://localhost/cs_login/themes/blackcandy/images/mthood.jpg"/>
<div class="info_area"> </div>
</div></td>
<td><div class="photo_slider">
<img src="http://localhost/cs_login/themes/blackcandy/images/baloon.jpg"/>
<div class="info_area"> </div>
</div></td>
<td><div class="photo_slider">
<img src="http://localhost/cs_login/themes/blackcandy/images/lighthouse.jpg"/>
<div class="info_area"> </div>
</div></td>
<td><div class="photo_slider"> <img src="http://localhost/cs_login/themes/blackcandy/images/giraffe.jpg"/>
<div class="info_area"> </div>
</div></td>
</tr></table>
</div>What i am getting is four images in my page without any button for click...in the script i use to get a picture to click so that the image gets bigger.
I have attached the file hwere the script is working fine in simple html.
Hoping that someone will let me know the error and ways to make this working
thank you in advance -
Re: javascript not working in page

21 January 2010 at 5:32pm
The code looks good. Make sure your jquery is not clashing with ss jquery which is for example included with SS navigation bar. Do you have firebug installed? Is it reporting any errors in the console? Is the jquery.js and the photorevealer.js got loaded correctly.
Note: if you have Chrome, it has a debugger built in, you can start it via Viev>Developer>Developer Tools. You can also use IEDeveloperToolbar on IE8, although this is a beast
-
Re: javascript not working in page

21 January 2010 at 6:38pm
try to add the javascript line in page.ss
-
Re: javascript not working in page

24 January 2010 at 8:23am
i have tried all the steps but no error and even writting in page.ss does not works
-
Re: javascript not working in page

24 January 2010 at 9:20am
Well if you're getting a Blank Page with no HTML at all you're either calling a bad control or you have a typo somewhere. When you dev/build does it finish?
-
Re: javascript not working in page

26 January 2010 at 8:04am
except the javascript part the rest of the page is working fine..
the images are showing up in the page but the javascript is not working
| 1140 Views | ||
|
Page:
1
|
Go to Top |



