Active State On Thumbnail?

Jun 28, 2009

i have a list of thumbnails that are created dynamically from a database which have an transparency state when the thumbnail is in the active state (ie when someone clicks on it)I wondered is there anyway that the first one could be set to active by default when the page initially loads. My code is below:

<script language="JavaScript" type="application/javascript">
<!--
function setMainImage(imageId) {

[code]....

I wonder how I can highlight the active thumbnail so its background remains blue until I click another one.I also like to avoid the inline JavaScript.

View 10 Replies


ADVERTISEMENT

JQuery :: Turn On An 'inactive-state' CSS Class For A Group Of Divs, Then Reset One Div To The 'active-state' Class?

Feb 2, 2011

I am attempting to make a menu that has a background image that changeswhen you rollover or click a menuitem. I've got the hover effect working fine with CSS, but am trying to implement the click event via jquery with the following:

CSS:
div.SustainResourcesMenuTabs
{ background-image: url('/images/departments/commdev/sustainability/menu_tab.jpg');
}[code]....

My process is to reset the entire menu to the inactive state, then switch on the active state for the item that was clicked. Eventually, the item that was clicked will display its corresponding body section as well. I've tried using the CSS pseudo-class "active", but since the entire div is the link, that is unavailable. I've also tried multiple variations of addClass/removeClass, toggleClass, and setAttribute/removeAttributebut nothing hasworked so far.

View 2 Replies View Related

Highlight Active Thumbnail In A Slideshow?

Jul 8, 2011

Here's the slideshow embed code:

[code]...

I wonder how I can highlight the active thumbnail so its background remains blue until I click another one.I also like to avoid the inline JavaScript.

View 8 Replies View Related

JQuery :: Add Active State Class To CSS?

Jan 11, 2012

Having a navigation menu desighned in photoshop, how can I use jquery to add a active state class to my css which can use the same hover style for active menu?

Here is the HTML code:

<ul id="nav">
<li id="list1"><a href="#"><span>Home</span></a></li>
<li id="list2"><a href="#"><span>About Us</span></a></li>
<li id="list3"><a href="#"><span>Projects</span></a></li>

[Code]....

View 3 Replies View Related

Active State For Navigation Bar In Website

Jul 26, 2009

I'm quite new to web design and Javascript in particular. How to resolve a problem with the navigation bar in a website I am currently working on. The navigation bar has 3 main categories and there is an 'active' state so the page currently viewed is shown as grey underline text in the navigation bar. The thing is, I also have sub-categories that are not included in the navigation bar but I'd like to make it so the sub-category page currently being viewed makes the main category to which it is attached showing as 'active' in the navigation bar.

This is the structure of my site:
index.html
contact.thml
illustration
index.html
illustrationproject1.html
illustrationproject2.html
illustrationproject3.html
photography
index.html
photography1.html
photography2.html

So for example, if I'm in illustrationproject1.html, the Illustration tab in the navigation bar should be on the active state. This is the code I have so far:
Navigation Bar:
[CODE]
<ul id="nav">
<li class="nav_item"><a href="illustration/index.html">Illustration</a></li>
<li class="nav_item"><a href="photography/index.html">Photography</a></li>
<li class="nav_item"><a href="design/index.html">Design</a></li>
<li class="nav_item"><a href="stories/index.html">Stories</a></li>
<li class="nav_item"><a href="profile.html" title="Profile">Profile</a></li>
<li class="nav_item"><a href="contact.html" title="Contact">Contact</a></li>
<li class="nav_item"><a href="links.html" title="Links">Links</a></li>
</ul>
[ICODE]

This is the Javscript for the active state:
[CODE]
function setActive() {
aObj = document.getElementById('nav').getElementsByTagName('a');
for(i=0;i<aObj.length;i++) {
if(document.location.href.indexOf(aObj[i].href)>=0) {
aObj[i].className='active';
}}}
[ICODE]

So this code is working but I'm just not sure how to apply it to the subcategories as well. I can see what I should do, write some "if" statement but I don't enough of Javascript yet for this...

View 2 Replies View Related

Keeping 'on' State Active On Page?

Nov 7, 2010

At the link below I've built the nav using CSS (see code below). How do I make the 'on' state stay active on each specific page? (i.e the 'about us' rollover image stays active on the 'about us' page)

[URL]

CSS:
/* -----------begin nav layout styles-------------- */
#navigation {
width: 455px;
height: 116px;

[Code].....

View 4 Replies View Related

JQuery :: Ui Accordion - Getting Active Index And Active Header Text?

Jun 8, 2011

getting all the header text:jQuery("#accordion h3").text();how do you get the active index? and how do you use that index to get the active header?how do you get the header text for the active header?

View 1 Replies View Related

JQuery :: Why Does The Hover State Return To The Initial State

Nov 1, 2011

I used the code from the following article...[URL]

$(function() {
$('img[data-hover]').hover(function() {
$(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('data-hover')).attr('data-hover',

[code]...

why does the rolled over image's src return to the original value when the user rolls back off it?

View 1 Replies View Related

Toggle State - Trigger Open State From Id Based URL?

Jul 21, 2011

To say I'm new to JavaScript is a bit of an understatement so bear with me. I have a site set up with a variety of layers of toggles. When you enter the site all of the items are collapsed and you click the headings to expand. Each of the toggle-able items have ids. It works great for users who start at the homepage.

However, when I send people to any of the inner topics, all they see is the initial collapsed state of the site. I want to be able to provide a URL that will set the toggle to open, and show all of the content for that section on entry.

Here is my code and js, can anyone point me in the right direction?

[Code]....

View 2 Replies View Related

Preserve The Session State Of A SharePoint Browser State?

Jun 1, 2010

How can I preserve the session state of a SharePoint browser state using javascript?

View 2 Replies View Related

JQuery :: Hover - Checking "active" Status - Check That _li Is Not ".active" And Replace The Src If It Isn't?

Mar 6, 2009

I think this is just a dumb question, I'm missing some basic logic here about jquery "grammar".

I'm trying to do an image swap on hover that checks to be sure the thumbnail is not the active thumbnail. So mouseover, it swaps. Mouseout, swaps back, unless the thumb has been clicked.

Here's a snippet of the code that doesn't work:

How do I check that _li is not ".active" and replace the src if it isn't?

View 10 Replies View Related

Thumbnail Viewer

Nov 7, 2007

I am looking for a Javascript program which will display a thumbnail view of
all the images in a particular folder.

If the user clicks on one of the thumbnail images then a larger view of the
image will be displayed.

I am presently using a forward/backward type of viewer.
The code I am using requires all the image file names to be named with an
ascending number as part of the file name.
For example ;
img001.jpg
img002.jpg
img003.jpg
etc. etc.


This scheme requires renaming all of the original file names, too much work
if you have lots of images and in addition it does not display thumbnails.
Can anyone point me to a better piece of Javascript code.

The Javascript code I am looking for should accept a folder name and should
not require renaming all the original images.

View 2 Replies View Related

Script For Pop Up From Thumbnail

Jul 20, 2005

Does anybody have a simple script that let's me popup a picture from a thumbnail?

View 1 Replies View Related

Thumbnail Open New Window

Jul 20, 2005

I have some thumbnails on that page with some JavaScript to open a new
windows in the different size if visitors click on the thumbnails.
But the problem is if you click the thumbnail before the page to
completely load up the page just stop loading and begin to load the
new window only.

View 5 Replies View Related

Highlighting A Thumbnail That's Been Selected?

Jan 10, 2010

I have a jQuery script running on my site that makes it so when you click on a thumbnail, a different overflow:hidden div is scrolled to the anchor point that thumbnail was linking to.I want to make it so the thumbnail that you clicked becomes selected (and all over thumbnails become unselected). This could be with a border, a shadow, an image appearing behind it, opacity - basically anything (preferably an image appearing behind it).

View 5 Replies View Related

Hover Over Thumbnail - Changes Two Different Divs?

Feb 1, 2010

I have 5 different thumbnail pictures. I also have two divs - "pic" is a larger picture of a thumbnail and the other "details" is description of the person in the picture.I would like the two divs to change depending on which thumbnail the mouse is hovering over.

HTML Code:

<body>
<div id="pic">
<img src="image1_large.jpg" alt="Image 1" class="Image1_large">
</div>

[code]....

View 5 Replies View Related

JQuery :: Getting Thumbnail Of Next Image In DIV

Apr 13, 2011

<ul>
<li><a href="dog.jpg"><img src="dog_t.jpg" alt="dog" /></a></li>
<li><a href="cat.jpg"><img src="cat_t.jpg" alt="cat" /></a></li>
<li><a href="pig.jpg"><img src="pig_t.jpg" alt="pig" /></a></li>
<li><a href="cow.jpg"><img src="cow_t.jpg" alt="cow" /></a></li>
</ul>

My jQuery is set up so that when I click on a thumbnail, a div opens up with the bigger image. I also want the thumbnail of the next image to appear in the same div. So if I click the cat, I want to see the large cat and the pig thumb. How do I tell it that I want the next IMG inside the next A inside the next LI?

View 5 Replies View Related

JQuery :: Add A Class To The Selected Thumbnail?

Jun 8, 2011

I have a thumbnail scroller using the jquery thumbnail scroller plugin, and i have added some code to make the linked larger image appear in an empty div above the scroller.

I have been trying to add a class to the selected thumbnail - which would be removed and applied to a new one upon click - however nothing i do seems to be working.

$(document).ready(function(){
$("ul#thumbnailImages li a").click(function(event) {
event.preventDefault();
var image = $(this).attr('href');

[Code].....

View 5 Replies View Related

JQuery :: Gallery With Sub Thumbnail Views?

Jun 11, 2009

I am currently trying to create a thumbnail gallery that when you select a thumbnail, it loads associated thumbnails specific to that image for alternate views. I have the base of the thumbnail gallery created (click thumbnail + view larger image). I am however having issues getting it to load the associated sub images. I have the default one working for when the page is initially loaded, but it is not properly swapping out the urls for the new images, so it always uses the same three sub images.Here is the jquery code I am using:

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){

[code]....

View 3 Replies View Related

JQuery :: Load Image Into A Certain Div From A Thumbnail?

Jun 2, 2011

I'm using joomla to build a website and I'm stuck to the point where the user is supposed to click a thumbnail and load the large image into a div where it shows another image. The code I have now is below and I'm sure something is very wrong:Here's the jQuery code:

var $j = jQuery.noConflict();
$j("a").click(function() {
$j("#imageBox").html($j("<img>").attr("src", this.href));

[code]....

How am I supposed to load the image from the link to the div?

View 1 Replies View Related

Getting The Horizontal Thumbnail Photo Scroller?

Oct 29, 2009

I am unable to find a JavaScript picture viewer that does what I would like it to do.I have created a wrapper div of specific size for the images to be displayed in. I want the thumbnail images to be horizontally at the top of the div and the "clicked" full-size image to appear within the same div, directly below the row of thumbnails. When a visitor opens the page the first image must be loaded automatically without having to click on the thumbnail.

View 1 Replies View Related

Display Image When Clicked On Thumbnail?

Mar 24, 2010

I have a table with 2 colums, the left column is to preview image and the right column is for 4 small thumbnails. Iwant the preview picture to change when clicked on the individual thumbnail.

<table width="816" height="303" border="1">
<tr>
<td width="396" height="297"> </td>[code].....

View 8 Replies View Related

Horizontal Scrolling Thumbnail Gallery?

Sep 28, 2010

Currently I'm looking at smooth scrolling Js scripts for thumb images which can be altered to accomodate needs. I found one here [URL] that has some desirable effects but has no navi buttons.Would it be sensible to alter and point the hovering mouse scroll function to buttons, or would it be a better to keep looking for exactly the right script? The 2 identical scrollers on this page are the look I want but these are flash;

[URL]

View 4 Replies View Related

Slideshow - Adding Thumbnail Support?

Jan 19, 2011

I am using a javascript slideshow called fadeshow. (Main code below).

I am wondering if there is a way to have thumbnail support, so I could allow the users to click on a thumbnail and have fadeshow go to that photo in the array. I have gotten a next / previous button working but also would like to add thumbnails.

How would I write an a href link to specify an image in the array?

View 2 Replies View Related

Coding An Enlarge Thumbnail Code?

Feb 28, 2011

What is the secrets or tricks of coding an enlarge thumbnail code? This is what I came out with so far...

<script language="JavaScript">
function enlarge(target)
{

[code]...

I would like to do the enlarging effect like this,[URL]

View 2 Replies View Related

Enlarge A Thumbnail On Mouse Over Events?

Nov 4, 2009

where they enlarge a thumbnail on mouse over events? I have seen a lot out there, but all seem to want to replace the image with a new larger image of the same kind. What I would prefere for it to do is enlarge or zoom the thumbnail image, so that 2 images are not needed for every image.

I did find somthing which does exactly what I need, but the enlarged image keeps flashing on and off for some reason. This is the code

<script type='text/javascript'>
function get(eid) {
var d = document;

[Code].....

I would imagine it has somthing to do with the pop image function, but not to sure.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved