Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Defining Images



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> HTML Forum
View previous topic :: View next topic  
Author Message
nicola.rose



Joined: 04 May 2008
Posts: 3

PostPosted: Sun May 04, 2008 12:27 pm    Post subject: Defining Images Reply with quote

Sorry if this has already been asked, but I don't really know the technical term for what I need to I don't know what to search for.

Is there a way to kind of 'define' and image by giving it a name, so that anywhere on the page that you type the name, that image will appear?

Basically, I've created a photo album template, but as it involved iframes and thumbnails (and thus multiple links for each picture), I don't want to have to go through changing every link every time I do a new photo album. Instead, I was hoping for something that goes at the top of the page along the lines of

<code here... image 1 src="http://....">
<code here... image 2 src="http://....">
<code here... image 2 src="http://....">

so that the rest of the page could just have <image src="image1"> instead of actual internet addresses - then each time I did a new photo album I could just change the adresses at the top rather than throughout the document.

This probably does exist and there are probably a million tutorials for this already, but as I said I don't know what it would be called so couldn't search it

any help much appreciated!

Thanks
Back to top
View user's profile Send private message
nicola.rose



Joined: 04 May 2008
Posts: 3

PostPosted: Sun May 04, 2008 11:28 pm    Post subject: Re: Defining Images Reply with quote

maybe it's not as simple as I thought...
Back to top
View user's profile Send private message
flabbyrabbit
500+ Club


Joined: 25 Jan 2007
Posts: 623
Location: Midlands, England

PostPosted: Sun May 04, 2008 11:42 pm    Post subject: Re: Defining Images Reply with quote

The easiest way i can see to do this is php.

You could define the links at the top like this:
Code:
<?php
$image1 = "http://www.images.com/image1.jpg";
$image2 = "http://www.images.com/image2.jpg";
?>

Then where you want the image you put for example:
Code:
<img src="<?php echo $image1; ?>">

Easy enough??

Flabby Rabbit
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
nicola.rose



Joined: 04 May 2008
Posts: 3

PostPosted: Sun May 04, 2008 11:55 pm    Post subject: Re: Defining Images Reply with quote

I'll try it and get back to you on how easy it is...

Thankyou!
Back to top
View user's profile Send private message
dflynn
500+ Club


Joined: 03 Oct 2007
Posts: 630
Location: Guelph, Canada

PostPosted: Mon May 05, 2008 1:39 am    Post subject: Re: Defining Images Reply with quote

you can use CSS like this:

In you css document:
Code:

#img1{
background-image:(url)"http://";
height: 100px;
width: 100px;
etc.
}




Then in your HTML:
Code:

<a href="put in a link if you want to link the image" id="img1">


then you page is full of links that pup up as images.


The only thing about this is that the Height and Width in your CSS has to be the right height and width of the picture or else you could cut it off. so it is useful when all your images are the same dimensons so you can copy paste a lot.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
rangana
500+ Club


Joined: 27 Feb 2008
Posts: 715
Location: Cebu City Philippines

PostPosted: Tue May 06, 2008 1:08 am    Post subject: Re: Defining Images Reply with quote

You could also decide if you want to use client-side (Javascript)...I could create one, but then I'll wait for your response, maybe the two suggestion have suffice your needs Wink
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> HTML Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap