JQuery :: Images List Items Class?

Jun 16, 2010

I am having trouble displaying in an alert the id of the list item which contains an image.here is the structure of li

<li id="IDr">
<img src="ImagesDoneTimelessDSC_0483_Thumb.png" alt="Zombie"/><span>Description</span>
<img class="Pink" src="ImagesPinkBanner.png" alt="Pink Banner"/><span

[code]....

View 2 Replies


ADVERTISEMENT

JQuery :: Fade Out List Items That Don't Have A Specific Class?

Sep 23, 2010

I have a list of links in a sidebar, each with an associated class name. When one of these links are clicked, I want to fade out all of the main content list items that do NOT have this class (ie - if I click on boots, I want to fade out the list items heels and sandals)

[Code]...

View 4 Replies View Related

JQuery :: Use The ToggleClass - Toggle The On And Off Class On List Items

Jun 2, 2010

I'm trying to toggle the on and off class on list items but having issues it working.

I only want the 'on' class on the element that is clicked. So if another element in the list is clicked it removes the 'on' class from the one that had it to the one that has been clicked.

$(document).ready(function(){

View 1 Replies View Related

Jquery :: Fading Images For Non List Items?

Sep 12, 2009

I followed a tutorial in .net magazine (a UK web design mag) on how to fade images using jQuery. I have followed it and I can now fade images for my menu, problem is, I am not sure how to append the code to all my to fade images for non list items. For example, I have a call to action button (just a telephone number with a graphic, I have used css sprites to add a hover to the graphic, but would now like to fade it using jquery. Still not managed to get this working, here is what I for my menu, which fades the images perfectly.

html:
Code:
<div id="navigation_primary">
<ul>
<li class="home hover"><a href="home">Home</a></li>
<li class="services hover"><a href="services">Services</a></li>
<li class="work hover"><a href="work">Work</a></li>
<!--<li class="blog hover"><a href="blog">Blog</a></li>-->
<li class="contact hover"><a href="contact">Contact</a></li>
</ul>
</div>

Here is my jQuery:
Code:
$(document).ready(function() {
navigationPrimary();
});

function navigationPrimary() {
$('#navigation_primary li').removeClass('hover');
$('#navigation_primary li a')
.css({ opacity: 1.0 })
.mouseover(function() {
$(this).stop().animate(
{ opacity: 0.0 }
, 300);
}) .....

View 1 Replies View Related

JQuery :: Changing Classes Of List Items Depending On The Amount Of Them And Current Class Name?

Mar 28, 2011

I'm trying to create a list that contains items which are filters for a search. The list shows 10 items (max) on the page load. if there are more than 10 it changes the class of the elements > 10 so they are hidden, and a 'show more' link is appended. Now if the user has 'unhidden' the previously hidden items and then chooses one, I want the class for all those previously hidden items to change until the user has deselected that item.

[Code]...

Is there a better, smaller way to write this? It works for what i need currently, but there are future features im planning that will not be practical checkingindividualindexes the way i've done it.

View 5 Replies View Related

JQuery :: Select Items With One Class, But Not Second Class?

Nov 25, 2010

<input type="text" class="class1">
<input type="text" class="class3">
<input type="text" class="class2">
<input type="text" class="class2 class1">
<input type="text" class="class1 class3">
<input type="text" class="class1">

Given the above, how would I select those that HAVE class1, but NOT class2, don't care about class3

So what I want are the items on lines 1,5 & 6 How could the below be modified to achieve what I want, or do I need something completely different?

View 1 Replies View Related

JQuery :: How To Add Menu Items In DIV Using Same Class

Jul 7, 2010

Trying to get data from xml file. Got it. Trying add data in class.
$(this).find('Category').each(function(){
var menuItem = ($(this).find('Label:first').text())
$(".DfMenu").text(menuItem)
alert(menuItem)
There are 4 menu item. Alert shows up right but it add same data in all menus one by one. How can I add four different menu item in four divs that is using the same class.

View 2 Replies View Related

JQuery :: Can't Have Click On Multiple Items With Same Class?

Oct 14, 2010

I'm trying to have multiple divs with the same class acting a s a button. I need to handle the click for each one. I will be obtaining the name attribute and passing that in an ajax call.However, this only works for one of the divs on the page, am I doing something wrong?

$(document).ready(function(){
$('#mark_sold').click(function() {
var item = $(this).attr("name");
alert(item+'clicked');
});
});

I'm also going to need to know how to refresh an image, too. I will be updating an image in the ajax call.

View 2 Replies View Related

JQuery :: Removing Some Items Of A Class & Keeping Others?

May 13, 2009

I have several conditional select boxes that populate from a database, using .ajax(). When the first select has an onchange, the second select populates normally. The same goes for the second and third selects. When I change the value of the second select box, the third box drops all dynamically created options and repopulates. When I change the value of the first select box, I can only empty the second box and repopulate. The third and future boxes keep their values.

The delete and repopulate piece of my function uses this bit of code: var dynamic_options = $("#" + next_dropdown_ID).children(".dynamic_option"); if ( dynamic_options ){ $("#"+ next_dropdown_ID + " .dynamic_option").remove()};

where next_dropdown_ID is the ID of the child select box. I've played with .find() and .filter() but the results are always either (a) ALL options with this class are removed, including the select I'm currently in, or (b)NO options with this class are removed.

Is it possible to delete ALL options on the page that have the ".dynamic_option" class, except for the children of the select box I'm currently in? I was hoping to be somewhat dynamic about it and not have to write an IF statement for every potential select box, so the code will be reusable. I can post the full function and HTML if more context is needed.

View 2 Replies View Related

JQuery :: Can't Manipulate List Items?

Sep 15, 2009

For some reason my loadFirstPage in the following code is unable to find the dynamically created list items built up in the buildGallery function. I have a button in the extended code that calls the loadFirstPage function on a click which works perfectly when I click it

var buildNavi = function(){
var naviTemplate ='<li class="prev"><a href="#" title="Previous">Previous</a>
</li><li><span class="current"></span><span class="total">

[code]....

View 4 Replies View Related

JQuery :: Adding Items To Checkbox List

Feb 20, 2011

I am having checkbox list and on top "add new" link. As I click on add new link dialog box appear exactly on checkbox list with form items and with submit button and as I click on submit button. Checkbox list appear with new added items.

View 1 Replies View Related

JQuery :: Jcarousel Not Scrolling Through All Items In List / Fix It?

Jan 27, 2011

I have 21 items in the list, but scrolling by hitting the right(next) icon only takes me to the 13th item and stops.

View 1 Replies View Related

JQuery :: Filter List Items W/ Sub-Lists?

Aug 5, 2009

I have selected a list that contains sub-lists. Now, I'd like to search for the list items that contain sub-lists (but not including
the sub-list-items). I think the example below will explain what I'm trying to do.

HTML:
<ul class="start-here">
<li>Do Not Need</li>
<li>NEED THIS ITEM[code].....

View 3 Replies View Related

JQuery :: Resizing Space Between List Items

Jun 3, 2009

I have created a simple portfolio item for a site I am working on, with left and right buttons to move between the visible thumbnails in the portfolio.

The problem is this: when I click on one of the left or right buttons used to scroll the active list items, it resizes the space between all of the thumbnails by 1 pixel per click, up to 10 clicks.

Here is the markup and my javascript:

View 1 Replies View Related

JQuery :: Set Certain Items In Select List To Selected

Aug 3, 2009

I have a multiple select list
<select id=mylist name=mylist[]>
<option id=1>first</option>
<option id=2>second</option>
<option id=3>third</option>
<option id=4>fourth</option>
<option id=5>fifth</option>
</select>

Then I have a string of id's that I want to set to selected like so.
var selectedIds = '1,3,5';
Is it possible to use jquery (preferably in a one liner) to set first, third and fifth to selected.?

View 3 Replies View Related

JQuery :: Target Specific Ul List Items For Css?

Jul 1, 2009

How would I target (with jQuery or normal javascript) the 5th and 6th li in an unsorted list for styling? I need to change the css for only 2 items in a list.

View 4 Replies View Related

JQuery :: List Checked Items In A Resultset?

May 20, 2010

I want to list out all the items that are checked in a resultset. I current have this to display the checked items.

$(function() {
$('input[type="checkbox"]').bind('click',function() {
if($(this).is(':checked')) {
$('#mydiv').append(' '+$(this).val());
}
});

How can i modify the code to remove the items from the list when it is unchecked?

View 5 Replies View Related

JQuery :: Select Only Top Level List Items?

Feb 7, 2011

Can anyone please tell me how to select only top level list items?[code]...

The answer I'm looking for is 3, since that is how many main listitems there are. How can I target only these main items?[code]...

View 2 Replies View Related

JQuery :: Hide Different Items In An Unordered List?

Apr 27, 2009

I want to modify the appearance of an unordered list by assigning a value to each list item and then setting the custom properties for each list item. At first I was thinking of assigning a number to each list item and then controlling it's properties via that number.But now I'm wondering if jQuery can do a search for the list items content.

View 4 Replies View Related

JQuery :: Using The Remove Function In List Items

Mar 1, 2010

I am having difficulties to deal with a simple remove function.

I have an item list with "listitem" css class. I placed a button on each item to delete it. I am now trying to use the remove function to erase it from the page. I thought $(this).remove(); will work but it doesn't. I also tried something like this: $(this).parent('.listitem').remove(); but it didn't work.

When I write $('.listitem').remove(); it erased all the items of the list. I m just trying to be able to erase just the one clicked.

View 5 Replies View Related

JQuery :: Superfish Parent Items And Images?

Dec 1, 2010

I'm building a Joomla site with Superfish vertical. I'm bogged down on 1 issue: parent itemid linked to specific images and how to make this work. My menu has 5 parent items. The child items are not an issue.My question is this: Does anyone know how to make linked parent/item id & images work together ? This may be more of a CSS issue than a script question but I thought I'd pass it by here as I'm getting "0" responses elsewhere and there could be a php/js script aspect to this.There is a bit of code (line 67-87 of superfish/tmpl/default.php) that has me concerned and it might turn out to be why this doen't work, I include it below. I'm pretty much illeterate when it comes to js /php but I can make out just enough to know it could impinge (either + or -) on what I'm trying to do.

if (($node->name() == 'li') && ($id = $node->attributes('id'))) {
if ($node->attributes('class')) {
$node->addAttribute('class', $node->attributes('class').' item'.$id);

[code]....

View 6 Replies View Related

JQuery :: Display Only A Certain Amount Of List Items On A Page?

Mar 29, 2010

I would like to display only a certain amount of list items on a page.

View 3 Replies View Related

JQuery :: Infinite Carousel - Two Empty List Items In Between

Sep 18, 2009

I've got an infinite jQuery carousel, which is working, however I need to make a couple of tweaks and I don't know where to start. Below is the code for a visually simplified, but technically identical version:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]">
<html xmlns="[URL]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Page Title</title>
<script src="[URL]" type="text/javascript"></script>
<script type="text/javascript">
$.fn.infiniteCarousel = function () {
function repeat(str, num) {
return new Array( num + 1 ).join( str );
} .....

Basically, I'm trying to achieve two things:
1. The script creates empty carousel items; these are visible in yellow when you scroll through the items by clicking on the blue squares. How can I remove these so that item '6' goes straight back to item '1', without the two empty list items in between?
2. At the moment two clicks allow you to see all 6 'real' squares, plus the two empty yellow ones. How can I make it so that it scrolls one list item at a time, rather than 4 at present?

View 3 Replies View Related

JQuery :: Item Position Replaced By Other Items Below In A List?

Apr 14, 2011

I have a page where there is a list of items and a drop container. When I drag item, the other items below the one that is being dragged moves up. Can other items stay in their respective positions when one of the item is dragged away?I have list of items like this:

<ul id="allItems">
<li id="node1" groupId="box2"><img src="nmm_logo.png" height=70 width=130 align="left""></img></li>

[code]...

View 3 Replies View Related

JQuery :: Adding Items To List - Proper Approach?

Jun 19, 2009

I'm trying to create a list, to which you can:
1. Add and remove items.
2. According to what's in this list, there should be dynamic content loaded on to the page.

I've accomplished 1 with the code below. I'm not sure about how to accomplish 2.
<script language="javascript">
var listItems = new Array();
var currentList = new String();
function listManager(task, id, name) {
//$("#debug").append(" ##### List manager. ("+listItems.length+"
items) #####
");
if(task == "add") {
refreshList(); // refresh the list .....

View 2 Replies View Related

JQuery :: Dynamically Creating / Removing Items From List

Jun 3, 2009

I'm trying to dynamically create and remove items from a list, it works just fine. Sort of, I can remove items, and create items, but once an item has been created, I cannot remove it again, but I can remove the items present when the page loads.

Here is my code
<div class="list">
<div class="item">
<input type="text" value="" /> <a href="" class="removeitem">Remove this item</a>
</div><div class="item">
<input type="text" value="" /> <a href="" class="removeitem">Remove this item</a>
</div><a href="" class="additem">Add item to list</a>
</div><script type="text/javascript">
// Add item to list
$('.additem').click(function(){
var template = $($(this).prev().get(0)).clone();
template.insertBefore($(this));
return false;
});
// Remove item from list
$('.removeitem').click(function(){
$(this).prev().parent().remove();
return false;
});
</script>
I can remove the 2 original items, but when I create new ones, they cannot be removed.

View 1 Replies View Related







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