/    Sign up×
Community /Pin to ProfileBookmark

I need some help, Please . . .

Hi folks! I’m green. Not with envy or jealousy, just new! I have a general question . . . I am trying to create an easy flowing site that uses a central iFrame for content viewing . . . I have a navbar on left with Img/MO img/click link to change content in frame(target) . . .
What I am trying to do is make it so that my readers do not have to ‘click’ the
actual text to have the content change. Am I clear?
I want my visitors to be able to hover over img(Category/Title button)-have image change(this part works okay) – AND HAVE CONTENT IN FRAME ALSO CHANGE AND REMAIN – WITHOUT HAVING TO CLICK.
Will the MO generator that is on this site do that?
Please advise.
Thanks! Have a great day!
Scribbler

to post a comment
Full-stack Developer

2 Comments(s)

Copy linkTweet thisAlerts:
@octonlineMar 25.2008 — Well, this can be accomplished with JavaScript, but it limits your potential users, and even though it is a neat idea, it still sounds as though it could get annoying.

Something like this (I don't know my Javascript, but this is just an estimate).

For the image a line like the following should work:
[code=php]<img src="foo.gif" onmouseover="do_change('foobar.html');" />[/code]

Then for the function:
[code=php]<script>
function do_change(href) {
document.getElementById("myFrameId").src=href;
// or maybe this if the above fails frames['myFrameName'].location.href = href;
}
</script>[/code]

Then the actual iframe:
[code=php]<iframe name="myFrameName" id="myFrameId"></iframe>[/code]

If memory serves me correctly, this should work fine. I would advise on using the "object" tag instead, for XHTML 1.0 strict validation. You may need to make slight modifications, particularly in the "do_change" function. Good luck.

Greg
Copy linkTweet thisAlerts:
@webgovernorMar 25.2008 — Greg is going around and helping people?

How very nice of you! I was just in your office but you weren't there.... granted that it's midnight and all.

About the script, it works, but it seems to take about a second or so before the actual change is made, and shouldn't this be moved to Javascript?

I wonder if he could get the same thing to work with Flash, loading into an HTML text area maybe? I don't know much about Flash anymore these days, but it might be possible.

Ugh, bed time for me, see you tomorrow.
×

Success!

Help @scribbler spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...