swapping text on mouseclick/mousedown... how

  • cerio
  • Proficient
  • Proficient
  • User avatar
  • Posts: 263
  • Loc: UK

Post 3+ Months Ago

I moved any <br> I could to outwith the headers and paragraphs, oddly I found it took less of them to create the same spacing that way, removed some bits in the code for the text that even I spotted had been left in the code accidentally and, though I haven't got the hang of CSS spacing yet, managed to use it to position the header.

The outcome is, the text no longer jumps when the site is viewed in Mozilla and Firefox, which is very satisfying. The opening text is now in the same position as the thumbnails' swap text in them as well as in IE.

Thank you so much for your help.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • perky_wren
  • Born
  • Born
  • perky_wren
  • Posts: 2

Post 3+ Months Ago

RichB wrote:
You might try a javascript function that changes the innerHTML of a span tag (or any innermost tag I think) and then call it from the onlick handler:


Searching through the next for exactly what the last person on this post was looking for, I came upon your posts and went OOOOH!

Just like her, I'm trying to build a site in DW. I already have thumbnails set up that load a larger version - so I need the text swapped. Like the previous poster, I have a lot of thumbnails, so making it all a graphic is not an option.

I'm posting this because er...

Having spent a day banging my head against the proverbial wall, I've found that I can't get the posts I've read here or elsewhere to work. :(

I mean they obviously DO work - but I'm missing something obvious!

In addition to that, the code I'm using to swap images is a bit different from the DW code.

I'm currently using:

Code: [ Select ]
function swapPhoto(photoSRC) {
documents.images.imgPhoto.src ="directory/folder/" + photoSRC;
  1. function swapPhoto(photoSRC) {
  2. documents.images.imgPhoto.src ="directory/folder/" + photoSRC;
  3. }

I have added the attribute 'name' to the main image on the page:

Code: [ Select ]
<img src="images/celeste.jpg" width="400" name="imgPhoto" />

While this works fine just swapping the image, I simply cannot figure out a way to get swapping the text to work as well.

I would so very much appreciate help on this if you, or anyone else has the time.
  • perky_wren
  • Born
  • Born
  • perky_wren
  • Posts: 2

Post 3+ Months Ago

I managed to figure out everything I needed to after taking a break and having dinner.

I'd just like to say a big thank you for all the immensely helpful posts here. :)
  • thebookdoc
  • Born
  • Born
  • thebookdoc
  • Posts: 1

Post 3+ Months Ago

This example might be helpful here. Shows how to add the links with a cursor change and applying to text as well as images and onMouseOver as well as onClick...

<style type="text/css">
cursor: hand;

<script type="text/javascript">
function changeCaption(text) {
if(document.getElementById) {
// -->
<p onclick="changeCaption('This is some text')" class="cursor">trouncy</p>
<img onclick="changeCaption('This is some other text')" src="myimage.gif" alt="" class="cursor">
<img onclick="changeCaption('This is brother of some other text')" src="myimage2.gif" alt="" class="cursor">
<a href="http://thebestwebsite.com"><img onclick="changeCaption('This is son of a brother of some other text')" src="myimage3.gif" alt=""></a>
<p onMouseOver="changeCaption('Default Message')" class="cursor">default message</p>
<p onMouseOver="changeCaption('')" class="cursor">Clear</p>
<table><tr><td><span id="message">Default Message</span></td></tr></table>
  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2194
  • Loc: Canada

Post 3+ Months Ago

It's pretty simple to deconstruct :)

Post Information

  • Total Posts in this topic: 35 posts
  • Users browsing this forum: No registered users and 25 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.