473,748 Members | 2,578 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.getEl ementById) {
document.getEle mentById('place holder').src = whichpic.href;
if (whichpic.title ) {
document.getEle mentById('desc' ).childNodes[0].nodeValue =
whichpic.title;

} else {
document.getEle mentById('desc' ).childNodes[0].nodeValue =
whichpic.childN odes[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.j pg" 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">Star t 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 1659
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
3256
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 about hot scripts, etc. but I was wondering if any one could recommend one? Secondly, I also want to setup a journal. It's not really a "blog" although I guess blog software may work. But it isn't going to be a message board or anything like...
1
1933
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 it. I want a functionality whereby users can click their mouse on any point in this image and it would then show a virtual mouse pointer at the place where
4
2236
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 front the scenario is this: A user clicks "Autumn". The user is presented with the "Autumn" thumbnails. If he click a thumbnail, the corresponding big image is displayed. Well, u
10
15699
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 image (that contains smaller images) and I would like to assign the smaller images as hyperlinks. What is the best way to do this? I know I can use an imagemap, but is
2
1732
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 move up and down, as the user scrolls up and down on the page. Can any of you folks suggest how I would envelope the following code
3
2048
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 started? Is there any sample code? Thanks, Michael
2
1728
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 kilobyte size of them (optimise for web)
7
3789
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. time / date Nice to have:
9
1878
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 itself. Here's the code. This used to succeed until my hosting provider changed something on his end. Now he's struggling to restore the functionality that used to work. <?php
0
8996
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6799
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.