473,387 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Javascript Slide up en down by click doesn't work

Thew
69
Hi

Im working on an HTML5 Valid and Javascripted page of my website. For that im using Motionpack.

This is my webpage: http://html5.alphenweer.nl/ (dutch)

I want if someone clicks on radar, there appears a little radar underneath. But then, if someone clicks on that little radar, underneath all maps there comes a bigger radar.

So this is the code i build:

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <title>AlphenWeer.nl [HTML5] - AlphenWeerOnline - AlphenWeer.nl</title>
  5.         <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
  6.         <script type="text/javascript" src="motionpack.js"></script> 
  7.         <script type="text/javascript">
  8.         function replaceit(v) {
  9.     if(v = "1"){
  10.         slidedown('extra');
  11.         document.getElementById('extrabutton').style.display='inline';
  12.         document.getElementById('extra').innerHtml='<img src="http://html5.alphenweer.nl/html5getimages.php?type=1&image=1"/>';
  13.     }
  14.     else if(v = "2"){
  15.         slidedown('extra');
  16.         document.getElementById('extrabutton').style.display='inline';
  17.         document.getElementById('extra').innerHtml='<img src="http://www.knmi.nl/actueel/images/tempgmt.png"/>';
  18.     }
  19.     else if(v = "3"){
  20.         slidedown('extra');
  21.         document.getElementById('extrabutton').style.display='inline';
  22.         document.getElementById('extra').innerHtml='<img src="http://www.knmi.nl/actueel/images/tempgmt.png"/>';
  23.     }
  24.     else if(v = "4"){
  25.         slidedown('extra');
  26.         document.getElementById('extrabutton').style.display='inline';
  27.         document.getElementById('extra').innerHtml='<img src="http://www.knmi.nl/actueel/images/tempgmt.png"/>';
  28.     }
  29.     else
  30.     {
  31.         document.getElementById('extrabutton').style.display='inline';
  32.         document.getElementById('extra').innerHtml='<p>Fout tijdens selecteren JAVASCRIPT</p>';
  33.     }
  34. }
  35.         function repup(j) {
  36.         slideup(j);
  37.         document.getElementById('extrabutton').style.display='none';
  38. }
  39.  
  40. </script>
  41.         <style type="text/css">
  42.             body {
  43.                 font-family: Arial,Helvetica,sans-serif;
  44.                 color: black;
  45.                 text-align:center; 
  46.                 background-color:#99D9EA;
  47.             }
  48.  
  49.             #container {
  50.                 background-color:white;
  51.                 border:1px solid black;
  52.                 width:800px;
  53.                 margin: 0 auto;
  54.             }
  55.  
  56.             #center {
  57.                 text-align: center;
  58.                 margin: 0 auto;
  59.                 border:0;
  60.             }
  61.  
  62.             img {
  63.                 border:0;
  64.             }
  65.         </style>
  66.     </head>
  67.     <body>
  68.             <div id="container">
  69.                 <h1>AlphenWeerOnline [HTML5]<br></h1>
  70.                 <table id="center">
  71.                     <tr>
  72.                         <td>
  73.                             <a href="javascript:;" onclick="toggleSlide('radar');" >Radar</a>
  74.                         </td>
  75.                         <td>
  76.                             <a href="javascript:;" onclick="toggleSlide('temperatuur')">Temperatuur</a>
  77.                         </td>
  78.                         <td>
  79.                             <a href="javascript:;" onclick="toggleSlide('satteliet')">Satteliet</a>
  80.                         </td>
  81.                     </tr>
  82.                     <tr>
  83.                         <td>
  84.                             <div id="radar" style="display:none; height:300px;">
  85.                                 <p>
  86.                                     Radar nederland
  87.                                 </p>
  88.                                     <a href="javascript:;" onclick="replaceit('1');"><img src="http://html5.alphenweer.nl/html5getimages.php?type=1&amp;image=1" alt="Radar nederland"/></a>
  89.                             </div>
  90.                         </td>
  91.                         <td>
  92.                             <div id="temperatuur" style="display:none; height: 300px;">
  93.                                 <p>
  94.                                     Temperatuur nederland
  95.                                 </p>
  96.                                     <img src="http://www.knmi.nl/actueel/images/tempgmt.png" style="width:256px; height:256px;"/>
  97.                             </div>
  98.                         </td>
  99.                         <td>
  100.                             <div id="satteliet" style="display:none; height:300px;">
  101.                                 <p>
  102.                                     Satteliet
  103.                                 </p>
  104.                                     <img src="http://html5.alphenweer.nl/html5getimages.php?type=1&amp;image=2" style="width:256; height:256px;"/>
  105.                             </div>
  106.                         </td>
  107.                     </tr>
  108.                     <tr>
  109.                         <td>
  110.                             <a href="javascript:;" onclick="toggleSlide('alphen-af')">Alphen Afgelopen 2 uur</a>
  111.                         </td>
  112.                         <td>
  113.                             <a href="javascript:;" onclick="toggleSlide('alphen-k2')">Alphen Komende 2 uur</a>
  114.                         </td>
  115.                         <td>
  116.                             <a href="javascript:;" onclick="toggleSlide('wind')">Wind</a>
  117.                         </td>
  118.                     </tr>
  119.                     <tr>
  120.                         <td>
  121.                             <div id="alphen-af" style="display:none; height:300px;">
  122.                                 <p>
  123.                                     Alphen afgelopen 2 uur
  124.                                 </p>
  125.                                     <script type="text/javascript" src="af.js"></script>
  126.                             </div>
  127.                         </td>
  128.                         <td>
  129.                             <div id="alphen-k2" style="display:none; height:300px;">
  130.                                 <p>
  131.                                     Komende 2 uur
  132.                                 </p>
  133.                                     <script type="text/javascript" src="k2.js"></script>
  134.                             </div>
  135.                         </td>
  136.                         <td>
  137.                             <div id="wind" style="display:none; height:300px;">
  138.                                 <p>
  139.                                     Wind
  140.                                 </p>
  141.                                     <img src="http://www.knmi.nl/actueel/images/windbftgmt.png" style="width:256px; height:256px;"/>
  142.                             </div>
  143.                         </td>
  144.                     </tr>
  145.                 </table>
  146.                 <div id="extrabutton" style="display:none;">Close</div>
  147.                 <div id="extra" style="display:none;">
  148.             </div>
  149.     </body>
  150. </html>
  151.  
But this doesn't work. Can y'all help me? Thanks.
Nov 10 '10 #1
0 1409

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Luca | last post by:
About one month ago I have inserted in my web site a clickcounter who controls the access to almost every link, but this script who changed the path in every link so the search engines couldn't...
5
by: Gary Mayor | last post by:
Hi, If I have the ' character within the javascript:pick command it doesn't work. Is there some sort of way of escaping these characters like in server side languages. function pick(symbol) {...
5
by: TrvlOrm | last post by:
HI There, I have been struggling with JavaScript code for days now, and this is my last resort! Please help... I am trying to create a JavaScript slide show with links for Next Slide,...
2
by: francisco lopez | last post by:
Yesterday I had a problem with a javascript to validate my form, but you helped my out yesterday and it works now perfectly!!! so thank you!!! the problem I have now is the following: I put...
8
by: marslee | last post by:
I know how to use buttons to go to the next and previous picture in slide show, but i want to change it so when the user clicks the picture instead of button, the script shows the next phicture. ...
2
by: Leszek | last post by:
I' got a problem with a web site i wrote a javascript: function zmiana(ile){ while(document.getElementById('accomp').childNodes.length>3){ ostatni=document.getElementById('accomp').lastChild;...
1
by: Alex Chun | last post by:
I have an Access database -- a .mdb file -- on a server on our network. When the file is in use -- i.e. there is an associated .ldb file -- I cannot open the database by double-clicking its icon;...
5
by: celestialgal86 | last post by:
Hi everyone... I'm a starter at .Net programming, and I need some help. I was asked to develop a console app that will auto-hide the console window and show a system tray icon. And by...
0
by: daonho | last post by:
I've been trying to figure out this problem for so long but no luck. The problem is that I have a ASP.NET Drop Down Listbox with a few item in there, and whenever I select an item from the listbox, I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.