Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Load an image in the same page AFTER clicking a link


  • Please log in to reply

#1
Supercalifragilistic

Supercalifragilistic

    Member

  • Member
  • PipPipPip
  • 404 posts
I want it so that there's no image, but when someone clicks "contact", an image of my email appears. Possible?
  • 0

Advertisements


#2
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Possible using a script or even just a mouseover of Contact can bring up the image.

Ron
  • 0

#3
jpshortstuff

jpshortstuff

    Member

  • Member
  • PipPipPip
  • 119 posts
Hi,

i'd use JavaScript.

Heres how id do it:

In the BODY tag, wherever fits your layout:
<a onclick="displayEmail()">Contact</a>

<!--Whereever you want this image to appear-->
<div id="contactImage">
</div>

In the HEAD tag:
<script type="text/javascript">

function displayEmail(){

	var img = document.createElement('img'); //creates and <img> element and stores it in the 'img' var
	img.setAttribute('src', "myImage.gif"); //sets the source of the element
	document.getElementById('contactImage').appendChild(img); //adds that <img> element to the <div> with id of 'contactImage'

}
</script>

and thats how simple it is :whistling:

Any queries about that then just ask,

jpshortstuff

Edited by jpshortstuff, 19 July 2007 - 04:08 PM.

  • 0

#4
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Possible using a script or even just a mouseover of Contact can bring up the image.

Ron
  • 0

#5
jpshortstuff

jpshortstuff

    Member

  • Member
  • PipPipPip
  • 119 posts
DUPLICATE

Edited by jpshortstuff, 19 July 2007 - 04:07 PM.

  • 0

#6
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Duplicate post removed because server hung up for over 30 minutes.

Ron

Edited by Major Payne, 19 July 2007 - 04:04 PM.

  • 0

#7
jpshortstuff

jpshortstuff

    Member

  • Member
  • PipPipPip
  • 119 posts
DUPLICATE

Edited by jpshortstuff, 19 July 2007 - 04:07 PM.

  • 0

#8
jpshortstuff

jpshortstuff

    Member

  • Member
  • PipPipPip
  • 119 posts
DUPLICATE

Edited by jpshortstuff, 19 July 2007 - 04:07 PM.

  • 0

#9
jpshortstuff

jpshortstuff

    Member

  • Member
  • PipPipPip
  • 119 posts
DUPLICATE

Edited by jpshortstuff, 19 July 2007 - 04:08 PM.

  • 0

#10
jpshortstuff

jpshortstuff

    Member

  • Member
  • PipPipPip
  • 119 posts
DUPLICATE

Edited by jpshortstuff, 19 July 2007 - 04:08 PM.

  • 0

Advertisements


#11
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Duplicate post removed because server hung up for over 30 minutes.

Ron

Edited by Major Payne, 19 July 2007 - 04:04 PM.

  • 0

#12
jpshortstuff

jpshortstuff

    Member

  • Member
  • PipPipPip
  • 119 posts
DUPLICATE

Edited by jpshortstuff, 19 July 2007 - 04:09 PM.

  • 0

#13
jpshortstuff

jpshortstuff

    Member

  • Member
  • PipPipPip
  • 119 posts
DUPLICATE

Edited by jpshortstuff, 19 July 2007 - 04:09 PM.

  • 0

#14
jpshortstuff

jpshortstuff

    Member

  • Member
  • PipPipPip
  • 119 posts
test
  • 0

#15
jpshortstuff

jpshortstuff

    Member

  • Member
  • PipPipPip
  • 119 posts
DUPLICATE

Edited by jpshortstuff, 19 July 2007 - 04:06 PM.

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP