Results 1 to 10 of 10
-
14th Apr 2012, 02:47 PM #1OPMemberWebsite's:
mkspot.orgShow/Hide div
Hello,
i working on school project. So i need to create table for stuff. Also when you click on the name or need to show additional div for info about prof.
here is table
when you click on Profesor4 info will show in profesor1
is need to show info in clicked profesor4 no profesor 1 here is code, css and javascript
Code:<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script language="JavaScript"> function toggle(id) { var state = document.getElementById(id).style.display; if (state == 'block') { document.getElementById(id).style.display = 'none'; } else { document.getElementById(id).style.display = 'block'; } } </script> <style> .tbody{ border-collapse: collapse; width: 500px; word-spacing: 2px; /**position: center; */ font-family: sans-serif; font-size: 18px; text-align: center; } .td{ border-style: double; border-width: 1px; padding: 2px 2px 2px 2px ; } .subject{ border-width: 1px; border-style: double; } #main{ width:500px; height: 20px; background: lightblue; } #hidden { width: auto; height:20px; background: aliceblue; display: none; } #img{ /**padding-left: 10px; padding-right: 5px; padding-left: 5px; **/ float: right; } </style> <title>Probna tabela</title> </head> <body> <table class="tbody" > <tbody> <tr> <td class="td">pROFESOR</td> <td class="td">Subject</td> </tr> <tr> <td class="td">Profesor1<a href="#" onclick="toggle('hidden');"><img id="img" src="http://127.0.0.1/kadar/plus.png"/></a> <div id="hidden">Info about prof.1</div></td> <td class="subject" rowspan="4">Македонски Јазик</td> </tr> <tr><td class="td">Profesor2<a href="#" onclick="toggle('hidden');"><img id="img" src="http://127.0.0.1/kadar/plus.png"/></a> <div id="hidden">Info about prof.2</div></td></tr> <tr><td class="td">profesor3<a href="#" onclick="toggle('hidden');"><img id="img" src="http://127.0.0.1/kadar/plus.png"/></a> <div id="hidden">Info about prof.3</div></td></tr> <tr><td class="td">Profesor4<a href="#" onclick="toggle('hidden');"><img id="img" src="http://127.0.0.1/kadar/plus.png"/></a> <div id="hidden">Info about prof.4</div> </td></tr> </table>
NightLightW Reviewed by NightLightW on . Show/Hide div Hello, i working on school project. So i need to create table for stuff. Also when you click on the name or http://i.imgur.com/Xof8h.png need to show additional div for info about prof. here is table http://i.imgur.com/46tJw.jpg when you click on Profesor4 info will show in profesor1 http://i.imgur.com/LDxSN.jpg is need to show info in clicked profesor4 no profesor 1 here is code, css and javascript <!DOCTYPE html> <html> Rating: 5
-
14th Apr 2012, 02:54 PM #2MemberWebsite's:
wscripts.net damnlolscript.com lulzjet.comin toggle('hidden') function you must set the id. The id must be unique on the page, you have the id "hidden" for all divs.
Try this:
Code:<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script language="JavaScript"> function toggle(id) { var state = document.getElementById(id).style.display; if (state == 'block') { document.getElementById(id).style.display = 'none'; } else { document.getElementById(id).style.display = 'block'; } } </script> <style> .tbody{ border-collapse: collapse; width: 500px; word-spacing: 2px; /**position: center; */ font-family: sans-serif; font-size: 18px; text-align: center; } .td{ border-style: double; border-width: 1px; padding: 2px 2px 2px 2px ; } .subject{ border-width: 1px; border-style: double; } #main{ width:500px; height: 20px; background: lightblue; } #hidden { width: auto; height:20px; background: aliceblue; display: none; } #img{ /**padding-left: 10px; padding-right: 5px; padding-left: 5px; **/ float: right; } </style> <title>Probna tabela</title> </head> <body> <table class="tbody" > <tbody> <tr> <td class="td">pROFESOR</td> <td class="td">Subject</td> </tr> <tr> <td class="td">Profesor1<a href="#" onclick="toggle('hidden1');"><img id="img" src="http://127.0.0.1/kadar/plus.png"/></a> <div id="hidden1">Info about prof.1</div></td> <td class="subject" rowspan="4">Македонски Јазик</td> </tr> <tr><td class="td">Profesor2<a href="#" onclick="toggle('hidden2');"><img id="img" src="http://127.0.0.1/kadar/plus.png"/></a> <div id="hidden2">Info about prof.2</div></td></tr> <tr><td class="td">profesor3<a href="#" onclick="toggle('hidden3');"><img id="img" src="http://127.0.0.1/kadar/plus.png"/></a> <div id="hidden3">Info about prof.3</div></td></tr> <tr><td class="td">Profesor4<a href="#" onclick="toggle('hidden4');"><img id="img" src="http://127.0.0.1/kadar/plus.png"/></a> <div id="hidden4">Info about prof.4</div> </td></tr> </table>
-
14th Apr 2012, 03:13 PM #3OPMemberWebsite's:
mkspot.orgokay now thanks very much. But the info is displayed immediately, I want to show info when clicked the professor or the image
or how can i do this on click to show info like this? Can you give some ex. code for this
this is web
Code:http://nova.edu.mk/EN/learning_at_nova/high_school/faculty_and_staff.aspx
-
15th Apr 2012, 04:13 PM #4Respected Member
Just right click that page and view source to see how it is done.
-
16th Apr 2012, 02:38 PM #5OPMemberWebsite's:
mkspot.org
-
16th Apr 2012, 03:45 PM #6Respected MemberWebsite's:
DL4Everything.com Soft2050.inTo achieve a similar effect, you could use jquery UI dialog: http://jqueryui.com/demos/dialog
-
16th Apr 2012, 04:25 PM #7OPMemberWebsite's:
mkspot.orgThis dialog is for showing info about one thing. I need for more then 20 person info to show in different dialog box on click.
ex.
If i click on Professor 1 to show info about Professor1
if i click on Professor 2 to show info about Professor2.....
is something like this on picture
you can see i click on Anglea and i can view info about Anglea if i click on Aleksandar i can see info about him
Thanks to all who helped me and want to help
-
18th Apr 2012, 01:16 PM #8MemberWebsite's:
vpsvolt.comJust right click the page. Save page as and then open it as a new site in Dreamweaver or your preferred code editing software and work the code down until all you are left with is the JS files and the code for the popout.
Thanks, VPSVolt.
-
27th Apr 2012, 05:52 PM #9OPMemberWebsite's:
mkspot.org
-
10th May 2012, 08:57 PM #10MemberWebsite's:
mjcoder.co.uk mjcoder.posterous.comim sure there are quite few jQuery plugins for this sort of thing. Have a look around.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Vbulletin] Hide links in 1 forum and show in another..??
By downloadsmasti in forum vBulletinReplies: 2Last Post: 30th May 2011, 09:31 AM -
review - tastro.org new show/hide javascript and new posting platform
By sloddl in forum Site ReviewsReplies: 9Last Post: 20th Jan 2011, 11:59 PM -
Hide / show remote file extension
By CatchItBaby in forum Technical Help Desk SupportReplies: 1Last Post: 9th Dec 2010, 07:51 PM -
How can I put option to show/hide Porn Section
By thatswhatshesaid in forum vBulletinReplies: 4Last Post: 10th Oct 2010, 04:12 AM -
show or hide javascript/jquery
By shadow.prx in forum Technical Help Desk SupportReplies: 0Last Post: 14th Nov 2009, 02:59 AM
themaCreator - create posts from...
Version 3.08 released. Open older version (or...