Click here to Skip to main content
15,909,193 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i want to add this slider to my web http://codepen.io/hkfoster/pen/ojEms[^]

i know how to use HTML code and CSS but i don't know where should i COPY javascript code

i attached the CSS to html in Dreamweaver and i want to know where i should put the javascript code of that slider !!!!!!!


plz help meeeee
Posted
Updated 21-Dec-13 8:34am
v2

1 solution

Hi,

See the code given has three parts. the HTML, CSS and Javascript. Since the javascript is acting on the HTML so it simply doesn't matter where you are going to put javascript. Though, the best place is inside head tag in a script tag pair.

With Regards
Tushar Srivastava
 
Share this answer
 
Comments
[no name] 22-Dec-13 4:36am    
@Tushar Srivastava can u tell me exaclty between witch tag i should paste it ?
Er. Tushar Srivastava 22-Dec-13 5:16am    
Yes, See when you open the link of code, you see three columns. The first is the HTML code. It must be placed inside the body tag where you want to display it. For example, if you want to display the slider in header, you should put the code there. The second column is CSS, it will go in your stylesheet file. The third column is a javascript file which uses jQuery. So, you have to copy this code in a new file for example slider.jquery.js and save it in the folder where your javascripts are residing. then import it in your html like this. <html><head> <!-- HERE --> <script type="text/javascript" src="<!--Source to JavaScript-->"></script></head><body></body></html>

Now, as per I am seeing, the javascript in the code is actually a plugin created using jQuery. So, you have to write extra codes for running the plugin.
Er. Tushar Srivastava 22-Dec-13 5:18am    
It is this .... <style type="text/javascript"> $(document).ready(function(){ $('.slider').slimSlider(); }); </style>
[no name] 22-Dec-13 5:49am    
oh , Thanks a lot it work a little but it doesn't have any effect i think it because i don't know where i exactly put <script type="text/javascript" src="slider.js" /> CODE or maybe it's for something else i took some screen shoot if you could see these and help me again
here is screen shoot ------> http://s5.picofile.com/file/8105157868/screen_shoot.png


Thank you so much again
Er. Tushar Srivastava 22-Dec-13 5:59am    
Alright friend, I have a comment to make and a few questions to ask. The comment is, You have to put <script type="text/javascript" src="slider.js"></script> since the short hand closing might not work though I am not 100% sure about it. The question is, where exactly are the slider HTML part of code? and Where is <style type="text/javascript"> $(document).ready(function(){ $('.slider').slimSlider(); }); </style> part of code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900