473,396 Members | 2,033 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,396 software developers and data experts.

show pictures on mouseover

underscore
hello guys!

i have design a program room reservation. in my page i want the customer when he/she point the mouse to the ROOM1, ROOM2 etc... i want thus picture in ROOM1/ROOM2 will show. if i leave the mouse 8 will also hide the picture automatically.... can u share me a code in this probs?


thnx people for you kind...
Aug 28 '07 #1
5 5261
pbmods
5,821 Expert 4TB
Heya, Underscore.

You posted this in the Articles section. I'll go ahead and move it to the Forum where an Expert will be more likely to find it.

This sounds like a job for JavaScript. I'm going to go ahead and move this thread to the JavaScript forum, where our resident Experts will be better able to help you out.
Aug 28 '07 #2
dmjpro
2,476 2GB
hello guys!

i have design a program room reservation. in my page i want the customer when he/she point the mouse to the ROOM1, ROOM2 etc... i want thus picture in ROOM1/ROOM2 will show. if i leave the mouse 8 will also hide the picture automatically.... can u share me a code in this probs?


thnx people for you kind...

Good Idea.
I would like to remind one thing that please don't use code words here.
This is a forum not a Chat Room.
Anyway come to your problem.
You try this code it may help you.

Expand|Select|Wrap|Line Numbers
  1. <input type=button name = room1 value = "ROOM1" onmouseover = "showPic(this.name)" onmouseout = "hidePic()">
  2. <input type=button name = room2 value = "ROOM2" onmouseover = "showPic(this.name)" onmouseout = "hidePic()">
  3. <!--I assumed your ROOM1 and ROOM2 as button-->
  4.  
Expand|Select|Wrap|Line Numbers
  1. var pic=null;
  2. function showPic(name)
  3. {
  4. //I assumed that the picture is the same as the name of Element.
  5. pic= document.createElement('<DIV>');
  6. pic.innerHTML="<img src='"+name+".jpg' style = 'width:180px;height:200px'>"
  7. pic.style.position = 'absolute';
  8. var ref = document.getElementsByName(name);
  9. pic.style.left = (ref[0].offsetLeft + ref[0].offsetWidth) + "px";
  10. pic.style.top = (ref[0].offsetTop + ref[0].offsetHeight) + "px";
  11. document.body.appendChild(pic);
  12. }
  13. function hidePic()
  14. {
  15. if(pic!=null)
  16. {
  17. pic.parentNode.removeChild(pic);
  18. pic=null;
  19. }
  20. }
  21.  
I think it will work.
If there is problem then come here experts are here to solve your problem.

Kind regards,
Dmjpro.
Aug 28 '07 #3
thnx for reply..

can we apply this to php?
Aug 28 '07 #4
dmjpro
2,476 2GB
thnx for reply..

can we apply this to php?
This code What I mentioned here this is totally Client Side Based.
No matter which Server-Side Technology you use.
Ok.
Anyway Best of luck with your try.

Kind regards,
Dmjpro.
Aug 28 '07 #5
pbmods
5,821 Expert 4TB
Heya, Underscore.

PHP doesn't work that way. PHP operates purely on the server; it puts together the HTML that gets sent to the browser.

Once the browser gets the HTML, though, the request is closed, and as far as PHP is concerned, the browser doesn't exist.

To allow the User to interact with your page, you have to use JavaScript. You can use PHP to output that JavaScript, but you still need to use JavaScript.
Aug 28 '07 #6

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

Similar topics

7
by: 7mary4 | last post by:
I am working on a kiosk for a museum, we will be using firefox as the browser, with windows, and a touch screen. We'd like to create a slide show of a small portfolio when the visitors click...
1
by: knoak | last post by:
Hi there, I have a site rendered from a mySQL DB, and it displays products. Each product is shown in it's own table with a picture, and some additional information. It looks like this:...
2
by: Alex | last post by:
On my page I have a lot string like this: <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc1</span> <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc2</span> <span...
2
by: Mateo | last post by:
Hi! I have a litle JS problem.... I'm trying to make show/hide table JS function, but my show/hide table function works only on IE.... It works in mozilla partially. Actually,every time when I...
11
by: Robert Baer | last post by:
The following passes the test as valid, and the mouseover for the six indicated areas also work. I need various areas to link to another page, including the six mentioned. However either the MAP...
3
by: Annette Acquaire | last post by:
I have and image map with a dozen hotspot links on it that I'm trying to get to open a new image over existing one on mouseover of each COORD. The only thing I was able to do was swap image on...
1
by: greatjuli | last post by:
Please can anyone help with a javascript code to display bigger pictures me.jpg, me2.jpg.... on the same page by clicking on their thumnails on the same page. I have done what i believe is the...
1
by: timmehtong | last post by:
I figured out my picture problem but this new one i have no clue on. Here's the scenario. There's 5 buttons and 1 blank area at the bottom. I press the first button and a bunch of pictures show up...
1
oranoos3000
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.