| | #1 |
| HyperActive Warrior Join Date: 2011
Posts: 101
Thanks: 27
Thanked 1 Time in 1 Post
|
Hi Everyone, I'm trying to create a landing page that has two images, and if you select one, it will turn on a highlight around it. Then if you select the other, it will turn off the highlight from the first one, and turn on the highlight for the one most recently selected. (and then toggle the highlighting if you click back to the first image) I don't know if this matters, but my page is using php, but I'm very new to it, and to css. Can anyone get me pointed in the right direction? Thanks in advance! - Pete |
|
Interested in Psychic Development? You've never seen anything like Miracle Mastery. Take a look!
| |
| |
| | #2 |
| Advanced Warrior War Room Member Join Date: 2006 Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
|
Pretty simple job with jQuery. Just add the following code to the <head> section (assuming you are using HTML5)... HTML Code: <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script> $(document).ready(function() { $('img').click(function(){ // when an image is clicked... $('img').css('border', ''); // first remove the border from all images $(this).css('border', '2px solid yellow'); // then add a border to selected image }); }); </script> |
| | |
| |
| | #3 |
| HyperActive Warrior Join Date: 2011
Posts: 101
Thanks: 27
Thanked 1 Time in 1 Post
|
Thanks! That's just what I was looking for!
|
|
Interested in Psychic Development? You've never seen anything like Miracle Mastery. Take a look!
| |
| |
|
| Bookmarks |
| Tags |
| change, click, images |
| |