473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Simple Image swapper needs more functionality

Hi everyone,
I would like to add hyperlinks to the text appearing or another when
working with the onClick event. Unfortunately this version is pulling
the text from the (title) attribute withing the <atag. Is there a
way to display linkable text in addition to the text and image that are
showing.

Does anyone know how to make this work with the script or another
method of tagging? Please help!

Here is a link to what I'm talking about.
http://www.freshoffshoots.com/gallery_exp/swapper.html
-------------The code--------------------------------

function showPic (whichpic) {
if (document.getElementById) {
document.getElementById('placeholder').src = whichpic.href;
if (whichpic.title) {
document.getElementById('desc').childNodes[0].nodeValue =
whichpic.title;

} else {
document.getElementById('desc').childNodes[0].nodeValue =
whichpic.childNodes[0].nodeValue;
}
return false;
} else {
return true;
}
}
</script>
<!--These are the links -->
<div>
<ul>
<li><a onclick="return showPic(this)" href="fullsize/B&H35cam.jpg"
title="B&H 35cam" <img src="thumb/B&H35cam_thumb.jpg" width="45"
height="42" border="0"></a></li>
<li><a onclick="return showPic(this)" href="fullsize/cinelin.jpg"
title="Cinema scene" ><img src="thumb/cinelin_thumb.jpg" width="45"
height="46" border="0"></a></li>
<li><a onclick="return showPic(this)" href="fullsize/devrycam.jpg"
title="devrycam is one good camera"><img src="thumb/devrycam.jpg"
width="45" height="31" border="0"></a></li>
</ul>

<!-- this is the description -->
<div id="display">
<div id="summary">
<p id="desc">Start with default text or the text of the image
showing</a></p>
</div>

<!-- this is the image -->
<div id="picbox">
<img id="placeholder" src="fullsize/B&H35cam.jpg" alt="Isn't it lovely"
/>
</div>
</div><!--end summary-->
</div><!--end display-->
</body>
</html>

Aug 17 '06 #1
4 1622
marco wrote:
I would like to add hyperlinks to the text appearing or another when
working with the onClick event. Unfortunately this version is pulling
the text from the (title) attribute withing the <atag. Is there a
way to display linkable text in addition to the text and image that are
showing.
To understand you better, you've got a picture and a caption that you
want to change when a text hyperlink is clicked? Or you want the
caption to be a hyperlink? Or something else?

-plato

Aug 18 '06 #2
Hi plato,
You are close on both but the caption to be hyperlinked seems the
closest.
My Ideal would be by sampling through each thumbnail three parts are
present, a picture, a caption and a link.
The how to introduce the hyperlink to the present format is my
question.

marco
plato wrote:
marco wrote:
I would like to add hyperlinks to the text appearing or another when
working with the onClick event. Unfortunately this version is pulling
the text from the (title) attribute withing the <atag. Is there a
way to display linkable text in addition to the text and image that are
showing.

To understand you better, you've got a picture and a caption that you
want to change when a text hyperlink is clicked? Or you want the
caption to be a hyperlink? Or something else?

-plato
Aug 18 '06 #3
I guess what I'm asking is this:

What is static? What is dynamic? What on the static side initiates
the dynamic side to change?

-plato

Aug 18 '06 #4
The small thumbnails on top are the static part. Inside the <atag of
each thumbnail you will see the onClick command and after it, the href
and the title. The href and the title are the static parts.

The dynamic parts are desc and placeholder. Both of these are css
layout id's e.g. <div id="desc"and <div id="placeholder">.

You can see in the actual javascript how (desc) is related to the
(title) attribute and (placeholder) is related (href).

This is the best I can do to describe the parts. If this doesn't make
sense I may have to scrap using this script.
What I do know is the limitations to it are based on using the
attributes of the <ato create the replacement parts. It isn't
possible to add an additional <a href=""withing any attribute. I
believe an all new script would have to be created in order to expand
beyond the boundaries of this one.

If you see a way to create linking text to this script I would be
grateful, if not don't knock yourself out. It may not be possible in
the current form of the script.

plato wrote:
I guess what I'm asking is this:

What is static? What is dynamic? What on the static side initiates
the dynamic side to change?

-plato
Aug 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Preston Crawford | last post by:
I'm looking to quickly get a photo album online. Very simple, thumbnails, a few pages, maybe a description, but hopefully a small script that's easy to edit and work into my existing site. I know...
1
by: newsgroupsKILLSPAM | last post by:
(*** apologies for the X-Post, but I felt it was relevant to all the groups ***) Hi guys, Would really appreciate some guidance with this. I have a page with a large centre-aligned image on...
4
by: Summasummarum | last post by:
Hi ng, I need some input/suggestions for a very small layout. The situation: Some groupings of thumbnails. For every picture (thumbnail) there is a "big" picture. Thats it basically :) On the...
10
by: Imran | last post by:
Hi, I am attempting to create a CSS-driven website, in that I want to be able to control the display/content from the CSS file. I do not want to use tables. On a page, I have a background...
2
by: George | last post by:
Hi, The code below comes directly from http://www.dynamicdrive.com. It does exactly half of what I'd like it to do. The other half is this: I'd like the image block of the changing images to...
3
by: Michael | last post by:
Hello, I want to write a componant that helps a user upload an image or file. I want something like you see on yahoo's image upload page. It has to work on mac and windows. Can anyone help me get...
2
by: Maxwell2006 | last post by:
Hi, I am developing a simple image upload asp.net page and I am looking for a simple image processing component to be able to change the image resolution of jpg images and also reduce the...
7
by: Ben | last post by:
Hi We are looking for a component that offers that offers the below for Tiff files: Image clean-up (deskew, despeckle) Printing capabilities from VB The ability to add text to image, e.g....
9
by: Tony Sosa | last post by:
Does anyone know what kind of tweaks I need to make to pertinent configs to render an image correctly? Right now, the text of the argument passed to imagejpeg is being shown instead of the image...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.