February 2, 201016 yr Hi, I have a javacript code which changes the colour of my table cell when i mouse over BUT my problem is I want it to also change a image i have inserted within the cell. See here - http://www.360italy.com/newlayout.htm I have placed just a normal rollover on the first image which changes it from a faded image to the normal clear image and what i want it to do is when I mouseover the table cell the background changes to the turqouise colour as normal and also the image changes to whatever one i specify. Can anyone help me? Thanks
February 2, 201016 yr Hi, Welcome to the forum. A couple of things mate. I'm a bit of a purist so don't take it personally. Your code is a total mess dude. Firstly, you don't need JavaScript to achieve what you're after. Simple XHTML and CSS will do the trick. Secondly, don't use tables for layout. It's so 1998 and it's wrong. Thirdly, use external files such as external stylesheets and JavaScript files and then reference them in your HTML. That's best practice for a number of reasons. Hope this helps.
February 2, 201016 yr Author Hi, Welcome to the forum. A couple of things mate. I'm a bit of a purist so don't take it personally. Your code is a total mess dude. Firstly, you don't need JavaScript to achieve what you're after. Simple XHTML and CSS will do the trick. Secondly, don't use tables for layout. It's so 1998 and it's wrong. Thirdly, use external files such as external stylesheets and JavaScript files and then reference them in your HTML. That's best practice for a number of reasons. Hope this helps. Hi Buddie, Many thanks for your reply and suggestions but other than tables i have never used divs or anything, looks very hard to use. Also I still dont know how to do what i asked, could you explain it on how i would achieve this? Many Thanks Jamie
February 2, 201016 yr Hi, No problem. Using XHTML and CSS is far easier and far less problematic than using tables for layout and JavaScript for rollover effects and the like. I would suggest starting with W3C Schools paying specific attention to the CSS Box Model and CSS floats. It would take you a couple of days to learn to build a site like yours using only XHTML and CSS. It's quite easy to learn and once you have you will never look back, that I promise. It will save you a hell of a lot of time and effort in the future, trust me. If you're going to do this for anything other than a hobby, you really need to learn the correct way of doing things, best practices and professional skills. Hope this helps.
February 2, 201016 yr Author Hi, No problem. Using XHTML and CSS is far easier and far less problematic than using tables for layout and JavaScript for rollover effects and the like. I would suggest starting with W3C Schools paying specific attention to the CSS Box Model and CSS floats. It would take you a couple of days to learn to build a site like yours using only XHTML and CSS. It's quite easy to learn and once you have you will never look back, that I promise. It will save you a hell of a lot of time and effort in the future, trust me. If you're going to do this for anything other than a hobby, you really need to learn the correct way of doing things, best practices and professional skills. Hope this helps. Ok cool thanks very much. But in the meantime could you tell me how to do what i asked in my first post? Many Thanks Jamie
February 5, 201016 yr Anyone? Thanks Jamie You would have a div that you assign a class to. The styling of the div would then be controlled using css. To display the background image, you would just need to add a class:hover attribute and set the background image. For example HTML <div class="hotel-box">Enter your hotel description and image in here.</div> CSS .hotel-box:hover {background-image:url('bgimage.jpg');} That's a very simple explanation but will hopefully be a good start.
February 5, 201016 yr Author Use HTML and CSS very easy Lol so someone has said, but im not that experienced that i can just go do it myself, i need some help. If you can provide the code i have to use etc that would be great. Thanks Monty
February 5, 201016 yr Author You would have a div that you assign a class to. The styling of the div would then be controlled using css. To display the background image, you would just need to add a class:hover attribute and set the background image. For example HTML <div class="hotel-box">Enter your hotel description and image in here.</div> CSS .hotel-box:hover {background-image:url('bgimage.jpg');} That's a very simple explanation but will hopefully be a good start. Many thanks for this! Ok i have inserted the code into the first box, my prob now is that the fade in the image only dissapears when you hover over the text, i need the fade to dissapear as soon as your arrow goes over the whole box and not just the text. How do i go about doing that? Many thanks Monty
February 8, 201016 yr Author Many thanks for this! Ok i have inserted the code into the first box, my prob now is that the fade in the image only dissapears when you hover over the text, i need the fade to dissapear as soon as your arrow goes over the whole box and not just the text. How do i go about doing that? Many thanks Monty Please can someone help me Thanks Monty
February 8, 201016 yr I'm in work at the moment so can't give you a solution right now. I will help this evening. You're trying to cobble a website together based on code snippets from various places though. I advise you spend some time learning the basics of XHTML and CSS, as it will help you greatly.
February 10, 201016 yr I think you need to refresh your skills. Your problem is easy to solve, but I think you would learn more by researching the solution your self or spending a couple of hours a day on w3c schools. Or type your problem into Google
Create an account or sign in to comment