| | |
HELP PLZ. content appear/disappear
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2009
Posts: 15
Reputation:
Solved Threads: 0
i'm trying to create a code where every content image in my html that is click must display a <div id="credits"> whenever the image is clicked.
so the <div id="credits"> must display information in a format where it shows:
File Name - image_file_name.jpg
File Size - image_file_size (with units of the image itself)
after an image is clicked on it must disappear after 3 seconds
so the <div id="credits"> must display information in a format where it shows:
File Name - image_file_name.jpg
File Size - image_file_size (with units of the image itself)
after an image is clicked on it must disappear after 3 seconds
Last edited by dmmajorstudent; Nov 5th, 2009 at 12:16 am.
0
#2 Nov 5th, 2009
html Syntax (Toggle Plain Text)
<img src='thisimg.jpg' width='80' height='80' alt='click for credits' onclick='document.getElementbyID("credits").innerhtml="File Name - thisimg.jpg<br> File Size - 80px*80px 15KB";setTimeout("document.getElementByID(\"credits\").innerhtml=\"\"",3000);>
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
•
•
Join Date: Nov 2009
Posts: 15
Reputation:
Solved Threads: 0
0
#3 Nov 5th, 2009
•
•
•
•
if populating images on the page from a database the scripting language can fill the blanks from the imagedetails storedhtml Syntax (Toggle Plain Text)
<img src='thisimg.jpg' width='80' height='80' alt='click for credits' onclick='document.getElementbyID("credits").innerhtml="File Name - thisimg.jpg<br> File Size - 80px*80px 15KB";setTimeout("document.getElementByID(\"credits\").innerhtml=\"\"",3000);>
i'm a little confused. using the code you sent and using my paragraph id i know that the image size is 216 by 136 cause i fixed it in photoshop. do i put in the width='80' height='80' ?????
<p class="info_title"><img src="img/ford.jpg" alt="deuce" />
0
#4 Nov 5th, 2009
thisimg is 80*80
thatimg is 640*500
theotherimg is 1024*768
yourimg is 216*136
You gave no details I made them up
Edit::left out closing quote
thatimg is 640*500
theotherimg is 1024*768
yourimg is 216*136
You gave no details I made them up
html Syntax (Toggle Plain Text)
<img src='thisimg.jpg' width='80' height='80' alt='click for credits' onclick='document.getElementbyID("credits").innerhtml="File Name - thisimg.jpg<br> File Size - 80px*80px 15KB";setTimeout("document.getElementByID(\"credits\").innerhtml=\"\"",3000);'>
Last edited by almostbob; Nov 5th, 2009 at 1:00 am.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
•
•
Join Date: Nov 2009
Posts: 15
Reputation:
Solved Threads: 0
0
#5 Nov 5th, 2009
•
•
•
•
thisimg is 80*80
thatimg is 640*500
theotherimg is 1024*768
yourimg is 216*136
You gave no details I made them up
Edit::left out closing quotehtml Syntax (Toggle Plain Text)
<img src='thisimg.jpg' width='80' height='80' alt='click for credits' onclick='document.getElementbyID("credits").innerhtml="File Name - thisimg.jpg<br> File Size - 80px*80px 15KB";setTimeout("document.getElementByID(\"credits\").innerhtml=\"\"",3000);'>
ah sorry about that. I have different images on my webpage that i need to allow the user to click on the image and then show the file size and name with the time out...
is there another code i can use that is not innerhtml? teacher is strict on not to use it. and im not getting much help from him. i have already adjusted all jpg to 216 by 136. do i need to put in the exact size and file name for the image? or does the javascript find out what it is automatically?
also by using my html code how do i add in the code in the html to make the java part work?
<p class="info_title"><img src="img/zephyr1.jpg" alt="zephyr" />
Last edited by dmmajorstudent; Nov 5th, 2009 at 2:22 am.
0
#6 Nov 5th, 2009
write the descriptions into <divs> with different ID, not the same id visibility hidden
then for the onclick event change the visibility of the div to inline or block
unchecked code thought process
then for the onclick event change the visibility of the div to inline or block
html Syntax (Toggle Plain Text)
<img src='thisimg.jpg' width='216' height='136' onclick='document.getElementbyid("thisdescr").style.visibility="inline";setwaittime("document.getElementbyid(\"thisdescr\").style.visibility=\"hidden\"",5000);'><div id='thisdescr' style='visibility:hidden;'>File Name - thisimg.jpg<br> File Size 15KB</div>
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
•
•
Join Date: Nov 2009
Posts: 15
Reputation:
Solved Threads: 0
0
#7 Nov 5th, 2009
oh i see what you did. thanks again. hopefully these are my final questions. using that code you wrote. how do i use arrays and dom scripting with dom core methods and properties without using innerhtml?
do i wrote a function and then take that code you wrote into the html?
for instance one of the pictures on my page has a file size of43.3kb and the dimensions are 216x136
do i wrote a function and then take that code you wrote into the html?
for instance one of the pictures on my page has a file size of43.3kb and the dimensions are 216x136
html Syntax (Toggle Plain Text)
<img src='img/karma.jpg' alt='karma' width='216' height='136' onclick='document.getElementbyid("thisdescr").style.visibility="inline";setwaittime("document.getElementbyid(\"thisdescr\").style.visibility=\"hidden\"",3000);'><div id='thisdescr' style='visibility:hidden;'>File Name - karma.jpg<br> File Size 43.3KB</div>
Last edited by peter_budo; Nov 5th, 2009 at 7:14 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
![]() |
Similar Threads
- python mysql doesnt work?plz help (Python)
- Combining Static & Dynamic content (JSP)
- hi i have prob solve it plz (Perl)
- Easy? Image in Form content? (JavaScript / DHTML / AJAX)
- DOMDocument::loadXML() [function.DOMDocument-loadXML]: Extra content (PHP)
- plz suggest me how to do this program (C)
- hi plz help me with this hijackthis log (Viruses, Spyware and other Nasties)
- Delete a post (Geeks' Lounge)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Redirect to page??
- Next Thread: Javascript stop function problem
Views: 367 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
acid2 ajax ajaxexample ajaxjspservlets array autoplay blackjack browser captcha captchaformproblem cart close codes column css date debugger decimal dependent design developer disablefirebug dom download element embed engine enter error events ext file firefox flash focus form frameworks game gears getselection google gxt hiddenvalue highlightedword hint html ie7 iframe index java javascript javascripthelp2020 javascripts jquery jsp libcurl listbox maps marquee masterpage media menu mp4 onerror onmouseoutdivproblem onmouseover parameters paypal pdf php player position post problem programming prototype rated rating redirect safari scale scriptlets scroll search security select size software solutions sources starrating synchronous toggle tweet unicode variables web webkit webservice window






