SEARCH YOUR SOLUTION HERE  

Making a mouseover/out task into function using classes for images

After many trials and errors finding exactly what someone wanted I came up with the solution I wanted for an image rollover. The problem is I put all the code directly into the mouseover/mouseout function. I am not sure how to implement this into two separate Javascript functions to limit the amount of code I have to write. The reason I am not sure how to write the function is because the images are in classes and the results are going to be pulled from a sql query, so they can't have their own id. So, in a nutshell, I just would like some guidance on how to put the mouseover/mouseout code into a Javascript function. Many thanks in advance. Here is my code markup.


Posted On: Sunday 23rd of December 2012 10:56:35 PM Total Views:  186
View Complete with Replies




Related Messages:

how to find the page which is rendered from the url by javascript   (206 Views)
I am developing a website in asp.net in which i need to remove class to the body tag if the page is index.aspx page. I want to do it by javascript. I am getting the current pathName and applying the following code bt after that it shows 404 page not found error: if (window.location.pathname = "/SWGT/index.com"){ $("body").removeClass("normalpage") ; }
Add Item to Combobox Dynamicaly   (80 Views)
In the given code I want that when i click on Add button a textbox appears & after typing an potion it will add it to the combobox options News Paper Name: Times Of India Indian Express The Hindu Outlook Economic Times Financial Express Business Line Hindustan Times Business Standards News Sector: On Government Of India Indian Political System Regulators Indian Banks, Financial Institutions & Insurance Core Sectors Infrastructure Other Sectors Small-Medium Enterprises Old Industrial Houses & Indian Family Qualities Large Corporates Media Strategic Application Corruption Indian Economy International Economic & Social Issues Icolumns By Eminent Personalities Editorial Cartoons Caricature Gossip & Mouth Shooting Quotes & Sayings Sports
Javascript DIV Replace Content   (57 Views)
Guys, Question about using Javascript to change the content of a given DIV inside the cell of a layout Table. I have this page http://www.servicema...om/PSN/PSN.html and for who its for, its more than adequate as it, but I want to allow the user to click on a nav item on the top bar and have the main content div change to display the correlating content. One more constraint is that I want the DIV to maintian the size of the current table cell and to place Scroll bars when needed. I feel like I've seen this done before, I just cant remember where and/or how it was done. I am also interested in placing a set of images within the Image Rotation placeholder and use a simple javascript link to allow the buttons on both sides to swap the images (I was thinking JQuery for this but I'm not sold on it).
calling a function with a string argument in 'onblur'   (165 Views)
. Now here is my problem. I want to call a function in the onblur event of an input text tag and pass a string to it as an argument. I'm having problem with how to pass it...whether to use single quotes or double quotes. Here is my code: function default_value(field,stringValue) { field.value=stringValue; } Should I use single quotes or double quotes when passing the string argument to the function
unique reference id   (101 Views)
I would like to be able to convert any reference (function, object, or array) into unique string id and retrieve original reference afterwards using same id. The following code does this but only for functions, and for some unknown reason ...
post table data into form   (230 Views)
I have a lot of tables and to get it to post some of the data into a form. So say i have a location and a start date and end date, and when i select a radio and click submit the location and dates get put into the corresponding field in the form. However i have a lot of tables and a lot of different options but want it to go to only one form. this form can be on a seperate page, but was wondering if its possible to get the form to appear on the same page, underneath the table.
I want a textbox to be automatically filled in   (245 Views)
Hopefully this makes sense but I what I want to happen is that when I select the date through the drop down menus for day, month and year, I want the semester textbox to automatically fill in the semester depending on the date chosen. e.g. If the user chose the date 23rd June 2012 from the drop down menus, then the semester textbox below should automatically be filled in with the semester 'Summer'. Is this actually possible in javascript Below is the dates and semester: 1st September - 30th November = Autumn 1st December - 28th February = Winter 1st March - 31st May = Spring 1st June - 30th August = Summer Below is my form: Date: Day 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Month January February March April May June July August September October November December Year 2012 2013 Semester:
creating introduction page with photo slideshow in blogger blog   (402 Views)
Iam maintaining a blogger BLOG.I want to create a intro for my blog as a website.In intro, i want to put a "photo slideshow" and a link called "Go to Homepage".When ever i clicked the link,it must be navigate to homepage of my blog. I tried for this.But not get the output properly..I can't get slideshow.That's the problem..
Browser Detecting using document.styleSheets   (138 Views)
ok so what im trying to do here is to check if it is IE and if it is then enable the IE Specific style sheet and disable the default one and vice versa(the else part of the if). for some reason it is working when i test it in firefox but it will not work when i do it in IE...i dont know if maybe its the version i am running (which is 6) but any help would be greatly appreciated. Thank you in advance. Here is my code: function detect() { var isIE = (navigator.appName == "Microsoft Internet Explorer"); if(isIE) { document.styleSheets[0].disabled = true; document.styleSheets[1].disabled = false; } else { document.styleSheets[0].disabled = false; document.styleSheets[1].disabled = true; } }
Code not working in Firefox!   (117 Views)
This piece of code works in chrome & IE but not Firefox, can anyone see why function openimage(a, b, c, d) { var b = document.getElementById('photo' + a).value; var c = document.getElementById('album' + a).value; var d = document.getElementById('clicks' + a).value; if (d = 1) { jQuery.facebox({ ajax: 'profile/previewphoto.inc.phpphoto=' + b + '&album=' + c + ' ' }) document.getElementById('clicks' + a).value = '2'; setTimeout('setitback(' + a + ')', 1500); } } function setitback(a) { document.getElementById('clicks' + a).value = '1'; }
onChange in Select to set variable for PHP driven?   (211 Views)
I am trying to create a form that will allow a user to update data in a mysql database. I want to call up the record being updated by the use of a select-option list at the top of the form. I have the code necessary to bring up the data in the form to be edited, however, I am struggling to get the select-option input to trigger the data to change. I'm certain that an onChange function on the select can accomplish this, but have no idea where to start. I'll appreciate any guidance on which function to use in the javascript. Code follows: Update Contact Information Personal Info: The rest of the code is just more inputs for the form.....
scanning files in a spec folder   (142 Views)
Hi I'm more than a little stuck and would appreciate a hint. I'm struggling to read files in a folder and then pass the variable to the following:
8x8 grid   (111 Views)
Can you help me write a program that displays and 8 by 8 grid of panels, all of which are initially colored white, but when the user presses the mouse within a panel, this color changes to a random color
javascript mind twister   (150 Views)
I have being trying to make a javascript code that will show different submenus depending on what was selected on the previous menu. Although my script has no bugs according to Internet Explorer it seems to not work in IE nor Crome. Can anybody see what's wrong with this code because it looks perfect but just doesn't work as in won't display the submenus on selection. function showprojecttype(var1) { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('divmodify').style.visibility = 'hidden'; document.getElementById('divcreate').style.visibility = 'hidden'; } else { if (document.layers) { // Netscape 4 document.divmodify.visibility = 'hidden'; document.divcreate.visibility = 'hidden'; } else { // IE 4 document.all.divmodify.style.visibility = 'hidden'; document.all.divcreate.style.visibility = 'hidden'; } } if (var1=='divcreate') { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('divcreate').style.visibility = 'visible'; } else { if (document.layers) { // Netscape 4 document.divcreate.visibility = 'visible'; } else { // IE 4 document.all.divcreate.style.visibility = 'visible'; } } } else { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('divmodify').style.visibility = 'visible'; } else { if (document.layers) { // Netscape 4 document.divmodify.visibility = 'visible'; } else { // IE 4 document.all.divmodify.style.visibility = 'visible'; } } } } Modify or Create: Create Modify option a option b option c option d If this text shows it probably works.