-6

i am new to CSS and JS.

I am trying to put a 'slider bar' in a page, following this instruction http://jsfiddle.net/juanmendez/v9zkB/. And i put the html, js, css file in the same directory. then i include the js and CSS source in html head as below (also, i included bootstrap files):

<head>
  <title>test_slider</title>
  <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css" />
  <script language="javascript" type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
  <link rel="stylesheet" type="text/css" href="slider_test.css" />
  <script language="javascript" type="text/javascript" src="slider_test.js"></script>
</head>

But there is not effect on html page from the js or css.

Ram
  • 143,282
  • 16
  • 168
  • 197
noben
  • 531
  • 1
  • 7
  • 16

2 Answers2

3

Did you included jQuery?

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

In jsFiddle on the left side, where it says Frameworks & Extensions you can see jQuery dependency loaded

Phil
  • 157,677
  • 23
  • 242
  • 245
CBeTJlu4ok
  • 1,072
  • 4
  • 18
  • 51
1

You need to include the jquery library in your header. Add this inside your header before any scripts

<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"></script>

EDIT: Didn't see your answer mpa4Hu. But yeah, make sure you add the jquery library BEFORE any other scripts

Basically, it should look like this:

  <head>
  <title>test_slider</title>
 <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css" />
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"></script>
  <script language="javascript" type="text/javascript" src="bootstrap/js/bootstrap.js">   </script>
  <link rel="stylesheet" type="text/css" href="slider_test.css" />
  <script language="javascript" type="text/javascript" src="slider_test.js"></script>
 </head>
Vim Bonsu
  • 1,852
  • 6
  • 21
  • 28