Log in

View Full Version : need a few scripts



xxknivesxx
11-17-2007, 09:33 PM
1. I need a script for linking images to iframe source.


2. I need the script for links that when your mouse isnt on them the image is faded, and when you put your mouse over it, it unfades.

3. I need a script that removes the underline from link and takes out the purple link after you have clicked it.


I need help with 1. 2.
the most, i looked everywhere, you guys are my last hope ! :{

djr33
11-17-2007, 09:38 PM
1. I don't understand what you mean.
Using target="framename" in the <a...> tag will set it to go to the iframe.

2. Use the hover state in CSS.
a {
color: #FFFFFF;
}
a.hover {
color: #CCCCCC;
}
Something like that.

3. That's "visited" links. Set that with CSS, or even in the body tag:
<body .... visited="#FFFFFF"> [white]

xxknivesxx
11-17-2007, 10:09 PM
how to link and target an image to an iframe

the link of the image or button needs to make it so that when u push it,that image directs the iframe to put that page/link from the button into the iframe

thetestingsite
11-17-2007, 10:30 PM
If that's the case, then the following code should work fine:



<a href="your_link_here.html" target="framename_here"><img src="image.png" style="border: 0px;"></a>


Hope this helps.

xxknivesxx
11-17-2007, 11:10 PM
thankyou!
and i still need a script on fade/unfade thing, the thing the guy posted above isnt what i exactly want, and i can't really find an example ._.

basicly, i want my links to be "faded"
and then when i have my mouse go over them they "unfade"

anyone understand / have a script? >_<

djr33
11-17-2007, 11:23 PM
Yes, it is what you want. Using the hover state on a link will allow you to change the color, ie, fade it.

When the mouse it over, it will be a different color than the normal links on the page. Using a brighter color on hover will make it "fade in".

It's vastly simpler than doing it by javascript, though I suppose you could set the visibility to 50%, then use onMouseover to set the visibility of the element to 100%, and onMouseout back to 50%.

However, actually having any movement (ie a change to brighter) would be much more complex and I think excessive.

95% of the sites you have seen with something like this use the CSS method. It's easy and compatible with almost every browser, and works for all users even those with javascript disabled.

xxknivesxx
11-18-2007, 12:09 AM
ah, i see, but can you give me a full script, like the other guy did? and where to put it?

thetestingsite
11-18-2007, 12:29 AM
He already did in his first post. You can place it in either a css file, or in between style tags in the head of your document. Example:



...
<head>
<style type="text/css">
a { color: #FFFFFF; } /* change to white */
a.hover {color: #CCCCCC; } /* change to dark gray */
</style>
</head>


Hope this helps.

xxknivesxx
11-18-2007, 12:37 AM
sorry i kind of didn't explain myself correctly my mistake,i want the code for like this example,the same thing like the white fade or whatever,but for an image so could you give me a full script like for an image thats a link that does that?,Thanks,Sorry for all the questions i'm new.

for instance this will be my image with the link <a href="your_link_here.html" target="framename_here"><img src="image.png" style="border: 0px;"></a>


and i want that to have the fade thing
but i dont want all links on the site to have the fade
just the ones i choose

djr33
11-18-2007, 01:42 AM
Ok, an image is very different than text. It seemed you were asking two separate questions.

There are two ways to go about this:

1. Set the opacity of the image to 50% at the start, onMouseover switch it to 100, then back to 50 onMouseout, using javascript. [Would allow interaction with whatever is behind it on the page, but you'd need to write this yourself.]

2. Use one of the many available rollover/mouseover image switchers, and create two images-- the bright one and the dim one, then switch accordingly. [Easy, and google will bring up many, many scripts.]

Note that the CSS hover state is used only for links, and though it has been suggested for use in other situations, but doesn't work in all browsers like that, so it's only a nice trick with <a> tags. Won't help in this case.

xxknivesxx
11-18-2007, 06:31 AM
are you able to get me the code*edit*script?

xxknivesxx
11-18-2007, 07:05 AM
hehe nevermind, i found these incase anyone wants to know how to rollover

http://www.yourhtmlsource.com/images/rollovers.html

http://www.quirksmode.org/js/mouseov_old.html