Help with Doctype and jquery selector
Hello, everyone, and please excuse my English.
I'm new to jquery and I have a small problem with the selectors.
In fact when I did not inform DOCTYPE in my code, the effect of opacity works fine. But when I say my DOCTYPE it looks like the selector $ (prev) and $ (next) no longer works.
Here is my code:
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
- <script type="text/javascript">
- <!--
- function initDiapo () {
- $(prev).fadeTo(0, 0.5, function () {$(prev).css('visibility', 'visible');});
- $(next).fadeTo(0, 0.5, function () {$(next).css('visibility', 'visible');});
- }
- //-->
- </script>
- </head>
- <body onload="initDiapo()">
- <div id="diapo">
- <img id="prev" src="./img/s_prev.jpg" alt="" style="visibility: hidden;" />
- <img id="next" src="./img/s_next.jpg" alt="" style="visibility: hidden;" />
- </div>
- </body>
- </html>
Thank you in advance for your help!
Good day!