Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
JavaScript Problem, need help
Old 10-16-2004, 03:59 PM JavaScript Problem, need help
Junior Talker

Posts: 1
Trades: 0
i dont get the width written to the image.. who should be more like this:
<img src="gallery2004.jpg" id="pictureview" width="returnvalue">

I no good with JS.. kinda newbie.. but really need to solve this problem, to complete my picture gallery..

Please be detailed, cause as i mention, iam no good with js

Thanks..





-- located in textstyles.js , which are added in head---

function editwidth(currentwidth) {

var blocklength = document.getElementByclassName('viewpic').offsetWi dth;

imageresize = document.getElementById('pictureview');

blocklength = blocklength * 0.90; /* 90% of the block */

if (currentwidth > blocklength){
var returnvalue = "90%";
}
else{
var returnvalue = currentwidth;
}

imageresize.style.width = returnvalue;

}





/* HTML codes */

<script language=\"JavaScript1.2\" defer>
editwidth(900);
</script>

<div class="viewpic">
<img src="gallery2004.jpg" id="pictureview">
</div>
pistre is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-18-2004, 06:48 AM
starsunited's Avatar
Extreme Talker

Posts: 211
Location: Singapore
Trades: 0
wat is ur problem then? i do not really understand though
starsunited is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to JavaScript Problem, need help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09518 seconds with 12 queries