473,320 Members | 1,910 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,320 software developers and data experts.

Adding a Style?

Hey guys,

How can I add a style to the image element that generating from this code? I mean, I assume that all I have to is add this line somewhere,

.NameOfTheStyle

Right?

================================================== =====


Expand|Select|Wrap|Line Numbers
  1. <!--
  2. function MM_preloadImages() { //v3.0
  3.   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  4.     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  5.     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i]; }}
  6. }
  7.  
  8. function MM_swapImgRestore() { //v3.0
  9.   var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  10. }
  11.  
  12. function MM_swapImage() { //v3.0
  13.   var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  14.    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
  15. }
  16. //-->
  17.  
  18. <!--
  19. function MM_findObj(n, d) { //v4.01
  20.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  21.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  22.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  23.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  24.   if(!x && d.getElementById) x=d.getElementById(n); return x;
  25. }
  26. //-->
  27.  
  28.  
================================================== =====


Thanks a lot.
Jan 8 '08 #1
3 1031
gits
5,390 Expert Mod 4TB
hi ...

even when i hate that crappy dreamweaver-code ... :) ... it seems that it uses a variable x in the functions to store a reference to the image, so for example try:

Expand|Select|Wrap|Line Numbers
  1. x.style.width = '200px';
so as you can see ... it's:

Expand|Select|Wrap|Line Numbers
  1. node_ref.style.style_property_name = value;
  2.  
kind regards
Jan 8 '08 #2
Hey thanks a lot. But I couldn't get it to work... I guess I don't know anything... Amway how can I add a Class that is generating from another JS file to this Dreamweaver code?

Thanks a lot.
Jan 9 '08 #3
gits
5,390 Expert Mod 4TB
to add a class you may use:

Expand|Select|Wrap|Line Numbers
  1. x.className = 'your_class_name';
kind regards
Jan 9 '08 #4

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

Similar topics

0
by: Andrés Giraldo | last post by:
Hi! I'm adding an asp button to a datagrid on the ItemDataBound event, when the user clicks on this button, I basically remove the button and create other 2 buttons... my problem is.. the 2 last...
4
by: Tonya | last post by:
Hi, Does anyone know how i can add controls to a progress bar. I have searched the internet but could not find any examples. what i want to add is a progress bar and a button. thx
10
by: Melissa Mussitsch | last post by:
I've done this before while creating a brand new table. But the code below is not working and I keep getting the error: "Internet Explorer cannot open the Internet site ..... Operation aborted" ...
32
by: Ed Jay | last post by:
A complete js newbie is asking this question: I have a form comprised of several questions, each answered with a radio button. I'd like to use onClick to bring up additional text at the end of...
2
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
7
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
11
by: Ørjan Langbakk | last post by:
I'm parsing a CSV-file into a table on a webpage - and I'd like to be able to change the alignment for the _last_ <td> in each <tr> - but, as the file is today, it's not possible for me to assign a...
11
by: Daz | last post by:
Hello everyone. I am sure the answer to my question is simple, but I can't seem to dynamically add an onClick event to my script. I have a table which is generated dynamically, I am just...
4
by: Rob Meade | last post by:
Hi all, Ok - this might sound kinda stupid - but I cant see how to do it... I've got an update panel which contains, on one horizontal line, a drop down list, then an image, then another drop...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.