JQuery :: Fading Multiple Text Items In And Out

Dec 10, 2010

When my page loads I want some text to fade in on my header, display for a few seconds, thenfade out, followed by a second piece of text which does the same, then a third etc. Ideally, I would like all the text elements to loop infinitely. I have managed to get the effect I want with one piece of text usingthese simple lines of code but am stumped when it comes to the subsequent ones. From what my small brain has computed I think the option may be to put all my text items in a list, set the initial list div to display: nonethen apply the fadein, display, fadeout to each in turn. But I don't know what I would put in the script to acheive this (create some sort of array with the li items?)

My searches keep leading me to image carousels etc which I couldn't work out how to configure for text. Also I'm not sure if the (hidden) list would just be dropped onto the page for non-javascipt enabled browsers messing up my page layout, so maybe I need to pull the text from a file / folder?
<script type="text/javascript">
$(function() {
$('#hdrtext').fadeIn(5000);
});
</script>
<div id="hdrtext">
first line of text
</div>

View 2 Replies


ADVERTISEMENT

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 :: Fading In/out Text In Relation To An Image?

Aug 18, 2010

I'm currently working on this page. The problem I have is when you hover over each image it fade's into color, I also want the text below to go from one color to another. Also, I want the image to fade in/out if you hover over the text below the image.

I used this tutorial and I'm using the two image technique which has the following jquery:

<!--
// wrap as a jQuery plugin and pass jQuery in to our anoymous function
(function ($) {
$.fn.cross = function (options) {

[Code].....

View 4 Replies View Related

Fading Multiple In And Out Divs On Click

Aug 8, 2007

What i would like to achieve is a single page with multiple fade in/fade out divs.
Like this section of the Apple site, click the navigation on the left, the different content sections fade in/out, the links are all hash links to id'd divs on the page. so the whole thing doesn't fall apart without the script.

I did a bit of a trawl and found this example that works on the mouseover, I had a look as the script and can't see how I would change it from 'hover' to 'click'.
The other I found was this one But the 'multiple' example on there seams to have some sort of 'flicker' and the examples all use script within the href which isn't great accessibility wise.

I also took a look at the Apple page, they are using 'scriptaculous' to do this, but they also do a bunch of other things on that page so finding the bit that just does the click fading, is a bit like a needle in a haystack.

View 2 Replies View Related

Jquery :: Fading Text And Image In Slideshow At The Same Time

Mar 26, 2010

I am trying to have text that is placed over an image cross fade into another image with text placed over it. I am using jquery and the images are cross fading perfectly. The text isn't working so well and in Firefox it seems to be very choppy and even sometimes the text just disappears and then there is a blank slide without any text or the text is showing up on the wrong image. Here is the code I have so far:

HTML Code:
<div id="slides">
<div class="slide">
<img src="_images/placeholder3.jpg" width="695" height="195" alt="A Passion for Service" />
<div class="slideText">
<h1>And A Different Heading</h1>
<p>With the appropriate solution for each client, we provide biomedical engineering and information technology services to suit your needs.</p>
[Code]...

I am new to jquery and am going through the Sitepoint book "JQuery: Novice to Ninja. I am using the crossfade code from the book and I tried to apply it to the text as well.

View 2 Replies View Related

JQuery :: Finding Multiple Items?

Nov 9, 2010

I have a table containing multiple rows (tr), each row has two columns (td). In the first columnIhave acheckbox, when this checkbox is clicked i need it to change the class of a div in the second column of the row.

[Code]...

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 :: Make Multiple Items Blink That Are Not Yet In The DOM?

Apr 24, 2011

I have a function called blink:

function blink(strObject) {
$(strObject).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);

[code]....

View 1 Replies View Related

JQuery :: Appending Multiple Items With The Same Span Name?

May 13, 2009

I need to append multiple spans to the line items in an unordered list. Essentially, each line item contains a <span> and I need to grab the content of that span and append it to the bottom of the line item it's contained in. Here's what I have so far: My jquery code:

$("ul").ready(function(){
var Name = $(".name") .text();
var Content = $(".content") .text();

[code].....

As you can see, instead of taking the all the "Name" var's and putting them together, instead of just using the "Name" var of that line item.

View 1 Replies View Related

JQuery :: Multiple Items For Click Event?

Feb 5, 2010

I have an image next to a checkbox and if either of them are clicked I want to run the same function. I've tried these so far

[Code]...

View 3 Replies View Related

JQuery :: Select Items With Multiple Classes

Feb 28, 2010

[code]I want to be able to highlight all of the divs which contain both the classes 'two' and 'three'. So the first and the third divs above are highlighted but the second isn't because it doesn't contiain both classes.I can see how to select multiple classes like this:$('.two, .three').css('background',''yellow');This selects items with either'two' or 'three' classes. I want it only to select the items with both classes.

View 1 Replies View Related

JQuery :: Toggle/Switch For Multiple Items?

Dec 29, 2009

I'm looking for a lightweight way to be able to switch between 2 divs on a page.

I have found various ways to do this online with jQuery, but none of which are able to handle multiple switches and make it extendable across the pages of my website efficiently.

For example I could have 12 - 15 individual elements on a page (All with same style) each with an option to switch content e.g. "Click here to do something" then once clicked "it would reveal something" (Within that element/<li> tag) - so it's element specific.

For example:

Code:
<ul>
<li class="box>
Title

[Code]....

But of course as it's element specific you have to associate each id together but you can't have two id="2" - as that won't validate.....

Looking around, a perfect example can be seen at: [URL]

And because it's CMS driven and will have multiple categories/pages, you can't list all the id's with the javascript, so it has to be portable/OOP (Is that the word?) so just a main identifier in the JS...??

Where you click to reveal code and it switches div, but only for that element, it doesn't effect anything else.

View 2 Replies View Related

JQuery :: Can't Get The Animation To Work Correctly With Multiple Items

Mar 13, 2010

If you look at this page [url] you will see that if you hover over the photo the text block goes up, and if you hover over the text it slides down and covers the photo. It's all pretty basic and it works fine. But ones I try to get them animated during the sliding up and down the trouble starts.

It works fine if you take the time and wait for them to go back to their starting position, but if you move over the items quickly it becomes a mess. You can see what I mean on this page [url]

I hoped that by adding a stop() before the animation if would fix the problem, but it doesn't really improve at all. It still quickly becomes a mess if you hover from one item to the next one.

How I could get the animations to work properly without it becoming a mess? I now there are double id's in the html, but unfortunately I can't really change the html.

View 1 Replies View Related

JQuery :: Assigning Different Event Handlers To Multiple Items

Feb 8, 2011

I have a simple filmstrip that uses getJSON to return data. The data is an array containing two arrays. The first, is the base path to photos. The second is a list of the photo file names. I am trying to loop through the array of photos and set them in divs. Then I need to attach an event to popup a larger view of the image placed in a dynamically generated div containing the image and initially hidden.

So what I am trying to accomplish is:
1. get JSON data from server.
2. get base image path from json data array
3. get list of images from json data array
4. Loop through list of images, prepend base path and assign to hard coded div.
5. create a dynamically generated div with larger version of same image.
6. Attach hover action to cause a mouse-over action on the hard coded div to popup the dynamically generated div containing the larger version of the image.

My issue is that once my code runs, no matter what image in the filmstrip I mouse over I always get a popup with the last image in it. Here is my code:
<script language="javascript">
$(document).ready(
function(){
$.getJSON("<?php echo site_url('filmstrip/index');?>",
function(data){
var dir = data['dir'];
var imgs = data['imgs'];
var i =0; .....

View 3 Replies View Related

JQuery :: Show/Hide Of Multiple Items At A Time With UL / LI / DL?

Dec 15, 2011

I have a UL group with multiple LI items, and each LI has a DL with a DT and DD inside. What I am trying to do is show EACH LI's DT, but not the DD. The DD will only show once the DT has been clicked (except for the first, which should be visible on page load.here is the structure code ... I am struggling to make this work using jQuery show/hide functionailty.

<!-- LIST -->
<ul class="examples">
<!-- ITEM #1 -->

[code]....

View 1 Replies View Related

JQuery :: Selecting And Rating Multiple Items From A List?

Jul 24, 2009

how to implement this bit of UI wizardry. I have a list of categories and the user is asked to pick all applicable items and then rate them individually. Right now I have a long list with checkboxes. Whenever a user checks one of the boxes a rating control pops up next to it and they just select the number of stars they want to rate the item.

Although this works for my purposes, it's a bit clumsy and takes up a lot of real estate (I have 30 items in the list so far and this may grow). What would be the best way to get this done?

View 1 Replies View Related

JQuery :: Selecting One Item And Manipulating Multiple Items?

Apr 15, 2011

I am missing something here but this is what I want to do. I want to select a checkbox as such

$('chkRequired');
Easy enough. But I want to then use $(this).attr('checked','true'); and then $(this).show(); and then $(this).next().show();
How can I formulate that into something like:

[Code].....

View 3 Replies View Related

Help W/ Fading Text Using Javascript....

Aug 29, 2002

What I'm trying to do is something similar to menu bar at the top of the page. Where it has Bio, Pictures, etc. I've searched the internet trying to figure it out and haven't had any luck.

View 7 Replies View Related

JQuery :: Multiple Select Boxes Affecting Visible Items

Feb 17, 2010

I'm quite new to jQuery and have this working, though I'm fairly sure if this won't be an efficient way to do this. I have a form with each day of the week, and each day has a choice in the number of slots which then shows the correct number of slots for entry for that day.

The form:
<table border="0" cellspacing="0" cellpadding="0" class="DataTable"><tbody>
<tr>
<th>
Day
</th>
<th>
Slots .....

This is simplified just a little as there are more than the 1 input in an 'Entry Section' (eg .Entry3). The jQuery I have working here is:
<script>
$(document).ready(function(){
$("#frmSlots1").change(onSelectChange);
});
function onSelectChange(){ .....

That's working fine, except I do want to have 7 days so that would be quite a lot of replicated jQuery code. I am thinking there will be a way to identify the select item with the others so jQuery will know which to adjust without having to spell every single item out. Is there an easy way to achieve this in the above?

View 1 Replies View Related

Ajax :: Jquery Function - Clicking Multiple Classed Items

Aug 5, 2009

I have some modules on my web site that have HTML similiar to this, where the tab is a dynamic generated number:

[Code]...

Basically, anytime someone presses the close class from one of tabs, using AJAX it eliminates it from their page. However, since their are multiple close classes on the page, its calling the AJAX a number of times if they have multiple tabs.

View 3 Replies View Related

Rotating Quotes With Text Fading

Dec 10, 2007

I've got a simple javascript that rotates quotes randomly. It's very basic, so I wanted to add a fade in/ fade out transition to the text to make it more appealing. I've researched around the net and have had trouble finding sources to help me out. Here is the code.

<script language="JavaScript">
function rotateEvery(sec)
{
var Quotation=new Array()

// QUOTATIONS
Quotation[0] = '...The big brown fox jumped over the tall fence'
Quotation[1] = '...The wind is blowing cold snow across the dark black road'
Quotation[2] = '...Fall has many colors and black is not one of them'
Quotation[3] = '...the blue bird lives in the big red barn'
Quotation[4] = '....Mr. Grant really believes that the Bull’s skills, which are widespread, are utterly godlike even though he acts like he doesn’t think so'
Quotation[5] = 'Sixth quotation'
Quotation[6] = 'You can add <b>as many</b> quotations <b>as you like</b>'

var which = Math.round(Math.random()*(Quotation.length - 1));
document.getElementById('textrotator').innerHTML = Quotation[which];

setTimeout('rotateEvery('+sec+')', sec*5500);
}
</script>

View 15 Replies View Related

Fading Text Inside Textbox

Sep 8, 2010

Take a look at this page:

[URL]

At the top you can see a search box with "Type search here". When you click into it the text disappears/reappears..

Is there a way i can have it so it fades in/out?

View 1 Replies View Related

JQuery :: Implement - Multiple Row Carousel - Display 9 Items At A Time On 2 Rows?

Aug 18, 2009

I'm wondering if there's a way to have multiple row carousel implemented.

I use jCarouselLite.. [url]

To be more specific, here's what I have:

And this is what I would like to accomplish:

I do realize that placing multiple items withing the <li></li> would be one approach, however I can't do that since the items are generated dynamically. The structure of my data (items) is an unordered list:

Using "float: left" & "clear: left" messes up the whole structure...

Any ideas how to display 9 items at a time on 2 rows?

View 2 Replies View Related

Way To Add Multiple Items With Single URL

Mar 15, 2010

I am looking for a way to add multiple items with a single URL to my shopping cart.

View 3 Replies View Related

Add Multiple Items With Single URL?

Mar 15, 2010

I am looking for a way to add multiple items with a single URL to my shopping cart. Is this possible?

View 4 Replies View Related

Changing The 'display' Of Multiple Items

Jul 20, 2005

I have a dynamically generated table, filled from a database by a perl
application.

Each row represents a database record and has a 'status' and a unique 'id'.

What I want to do is create buttons to hide all rows with a particular
status. The code to show/hide is relatively easy, but how do I turn them
all off at once?

Several ideas I had:

1. Set the tr's 'id' attribute to the status (eg 'open') and then set that
id to display: none. But that only turns off the first one.

2. Do the same but somehow loop over all elements looking for that id.

3. Set the tr's 'id' attribute to the status plus the data's id (eg
'open.24') then loop over all elements matching the status with a regexp.

4. Doing something else that I haven't thought of yet.

Anyone have any advice and example code?

View 2 Replies View Related







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