codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Brighten an Image on Click or Onload  laker67 at 00:54 on Monday, April 05, 2004
 

I was wondering if there is a function or method to Brighten an Image on Load(or Onclick) . The reason i need is i have an image gallery which lists all the images in smaller size on the left side of the webpage . when the user clicks on the smaller size image on left frame , it shows on the right side with its original size . I want to differniate the smaller image which the user clicked on the left frame from other images .
Thanks!!!!!!!!!!

  Re: Brighten an Image on Click or Onload  laker67 at 03:48 on Monday, April 05, 2004
 

Thanks for the tips provided . I do have to display images dynamically selected by the user . So i probably cannot have thumbnails .

I'm little new to web programming so please bear wiht me . You do suggest to use CSS border's .But how would i differniate between the image selected and not selected .

<img class="thumbNormal" src="/photo/thumb1.jpg">




  Re: Brighten an Image on Click or Onload  Troy Wolf at 04:24 on Monday, April 05, 2004
 

Here is a complete, tested, working page to show you some of these techniques. This script shows how to use CSS to format your page as well as how to use javascript to dynamically change the CSS properties of the page elements. It also has a DHTML technique to change the source of an image tag. Copy & Paste this into a new HTML file, then open in your browser.

<html>
<head>
<style>
body {
background-color:#000000;
color:#E27907;
font-family:Verdana,Arial;
font-size:10pt;
letter-spacing:2;
}
.thumbNormal {
border:4px solid #000000;
}
.thumbSelected {
border:4px solid #ff0000;
}
</style>
<script language=javascript>
var lastID = 0;
function SelectImg(id) {
if (lastID > 0) {
document.getElementById(lastID).className = "thumbNormal";
}
document.getElementById(id).className = "thumbSelected";
document.getElementById(0).src = document.getElementById(id).src;
lastID = id;
}
function LoadTrigger() {
SelectImg(1);
}
window.onload = LoadTrigger;
</script>
</head>
<body>
Click a photo on the left to view full size.
<table border=0>
<tr>
<td valign=top>
<img id=1 class="thumbNormal" src="http://sailfish.exis.net/~spook/3lio103.jpg" width=120 onclick="SelectImg(1)">
<br><img id=2 class="thumbNormal" src="http://sailfish.exis.net/~spook/3lio20.jpg" width=120 onclick="SelectImg(2)">
<br><img id=3 class="thumbNormal" src="http://sailfish.exis.net/~spook/3lion19.jpg" width=120 onclick="SelectImg(3)">
</td>
<td width=15> </td>
<td valign=top>
<img id=0 src="">
</td>
</tr>
</table>
</body>
</html>


Please let us know how it goes!
Troy Wolf: site expert
SnippetEdit Website Editor


  Re: Brighten an Image on Click or Onload  laker67 at 18:37 on Monday, April 05, 2004
 

I was looking for this statement
document.getElementById(id).className = "thumbSelected"; and thats exactly what you had . Thanks a bunch!!!!!


  Re: Brighten an Image on Click or Onload  TrueGret at 20:09 on Friday, May 07, 2004
 

Troy,
Neat code and thanks for posting it.

I am working with iFrames and am in need of some assistance.

I have page with table of a few links and a gallery of images. On top of this page I have an iFrame that is transparent and not visible with an html page
<body STYLE="background-color:transparent">
<table border="0">
<tr>
<td background="#000033" align="center" valign="middle">
<img src="/forum/picdisp.htm" name="picdisp" id="picdisp">
</td>
</tr>
</body>

that covers the table with the links to the galleries.

When the user clicks a link, I populate the table at the right with thumbnails. When the user clicks a thumbnail, the larger image of that thumbnail appears in the iFrame, but as an image and not in the img src named picdisp.

I have a button that allows the user, when clicked, to hide the iFrame and see the table of links again.

I am so close, but have a problem with the iFrame. I know I should be able to control the properties of the iFrame with something like:
document.frames("Frame1").document.body.style.visibility="hidden";


but can you tell me how I can change the src in the img object in the picdisp.htm page in the iFrame ...... ha, if that makes sense ....

The page is at Help needed here ... and click on the Multimedia|Images link to see what I mean.

Thanks for your help and if you have an alternate email address that might be easier, let me know.

TrueGret

  Re: Brighten an Image on Click or Onload  astrujic at 11:27 on Wednesday, September 22, 2004
 

This is how I did it in ASP.NET

You must set id="contenetFRM" and runat="server" attribute to your iframe.

With this line you are accessing to src property of iframe

contentFRM.Attributes["src"]="newframe.apx";

All Best,
Adnan








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: C++ Beginner question
•  Re: function within loop problem
•  moncler outlet
•  Re: Display swf file in pdf
•  Re: how to create forum using asp.net with c# language?
•  Discount coach store
•  Create Better Maps with Global Mapper
•  Re: How to display a message box when record is temporary stored in session/grid view
•  Sharing object in perl


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2012