jquery

Select from "value" to "value"

Hello I have this <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> <div class="item">7</div> <div class="item">8</div> and I want select from item 1 to item 5 and wrap them into an UL, and select 6 to 8 and wrapp them in another...

Javascript /jQuery variable print in HTML

I'm trying to add "Make an offer" buttons to the following web-page so people can click and fill out the modal popup form and then it e-mails their details: http://www.colincooke.com/coinpages/pennies_offer.html The modal works fine, but I can't seem to get the variables to output in the HTML. In the page this is HTML code for a table ...

Alert once (jQuery)

Is it possible to alert a user just once about something on his first visit? Can't use cookies because its a static site, only html and javascript are used. Thanks! ...

JQuery - get page?

Hi, I nearly have this going but don't have sufficient brain power to work out the final step. This is what happens at the moment. 1) Page loads 2) When a link is clicked, a hash is added to the url with the page id. This is saved to the browser history. I have the Ajax call set up, if I attach it to the link function it works fine. ...

In jQuery, $('body') can be selecting the body element, but $('body') can be just like $('some text'), so how to distinguish?

The reason is that we can do $('<div>some text</div>').prependTo('#someDiv') so, this is also ok to do: $('some text').prependTo('#someDiv') but we can't change some text to body? body is just as good as any text... (the above code is adding some text to the div with id someDiv, so what if I want to add the word body to the div?)...

Jquery special selection

Hello, I have the following html code: <div class="Radios"> <span class="radio"> <input type="radio" value="1"> yes <input type="radio" value="0"> no </span> </div> <div class="More">hello</div> <div class="More">hello</div> <div class="Radios"> <span class="radio"> <input type="radio" val...

Specifying multiple, different sources for jQuery FullCalendar

So I want to be able to specify multiple different sources for my FullCalendar implementation, I've got a number of Google Calendar feeds I want in my calendar but also a number of local feeds, all of which use the JSON datatype. I figured I could mix the sources like this: eventSources: [ $.fullCalendar.gcalFeed('http://www.googl...

Javascript - Getting data from XML for later use... put in array or object?

I am extracting a bunch of data from an XML file using jQuery. I need to use the data to fill in image paths, names, etc. What is the best way to gather all of this data for use? For instance, I get everything like so: $(document).ready(function() { $.ajax({ type: "GET", url: "st...

How to open links in ajax pages?

Hey guys i had use Ajax using jquery. Now i had one page and in that page their is one div, in which one page will be shown, lets say there is main-page.php and in that i have i had ajax-page.php [ which will shown in that div ]. Now ajax-page.php, is having some links and i want to open in that same div. Currently the links of ajax-pa...

The $(this) in jQuery is not a loop variable?

The following put the id name of each div inside the div as content: <div id="divDiv"> </div> <div id="divLink"> </div> [...] $('div').each(function() { $(this).prepend($(this).attr('id')) }) will work but $('#divStatus div').prepend($(this).attr('id')) will not. Why is that? I thought $(this) ...

Why does a book say DOM event flow has both Capturing and Bubbling? Then won't the event occur twice?

The book Professional Javascript by Zakas says that 1) IE uses event bubbling 2) Netscape uses event capturing 3) DOM event flow is first capturing and then bubbling So, won't the event handler be called twice? What is this DOM event flow, is it the DOM level 2 event handling? As I understands it, is the following true? a) IE 6, ...

Is there a way to make the jQuery UI slider start with 0 on top instead of on bottom?

Look at this demo of the jQuery UI Slider. Notice how when the handle is down the bottom, the value is 0? Is there a way to reverse this, so the handle up the very top is 0, and the handle down the bottom is the max range? I've played a bit with the options, but so far have been unable to get it to work. Thanks. ...

What is a good example to listen to event both at the "link" (or div) and at the parent or ancestor element?

Most of the time I see code registering an event listener for a link or a div or button, and handle everything from there. But the event capturing and bubbling is good to handle events at the offspring and then at the ancestor level. But what is a good example we will want to listen at 2 different places? ...

Will content loaded by AJAX affect SEO/Search Engines?

i wonder if content loaded dynamically by AJAX affect SEO/ability for search engines to index the page? i am thinking of doing a constantly loading page, something like the Tumblr dashboard where content is automatically loaded as the user scrolls down. ...

jquery - how to get the html inside a div

I have this html: <div class="portlet-header"> Company Information ... <button> some button here </button> </div> <div class="portlet-content"> <div class="content_regular"> <table style=" width:100%; height:100%;"> ...content </table> </div> </div> how do i get the hmtl after i click the butto...

In jQuery, how would I append a style align left to ALL elements?

I would like to have jQuery append a style="text-align: left;" to all elements on my page. I know I would probably have to do something like: $('everything-in-the-page').each( ... But I'm a little confused as to how I can select every HTML tag. JUST TO STOP THE BACKLASH: This is for an accessible site (print only). So, YES I KNOW it...

JS: Image upload live manipulation, scale, dimensions and crop

I am creating a CMS which has a number of images which a user can upload and attach to various places in the pages. I am trying to find a nice, preferably jquery based plugin or similar for scaling an image before allowing it to be cropped. I have implemented jCrop http://deepliquid.com/content/Jcrop.html which is working great. Howeve...

jQuery - How can I make this work (tag replacements)

Currently I have: this.html(this.html().replace(/<\/?([i-z]+)[^>]*>/gi, function(match, tag) { return (tag === 'p') ? match : '<p>'; return (tag === '/p') ? match : '</p>'; return (tag === 'script') ? match : 'script'; return (tag === '/script') ? match : '/script'; })); However...

Lazy loading a plugin (jQuery)

$('a.lightbox').hover(function () { if (jQuery().lightbox) { // required, otherwise lightbox.js will be loaded on hover each time $("a.lightbox").lightbox({ 'type': 'iframe', 'overlayOpacity': 0.5, 'width': 632, 'hideOnContentClick': false }); } else { ...

Reliably overlay div (tooltip) above modal JQuery UI Dialog?

I'm using CSS/Javascript to show tooltips for various inputs on mouseover. This works in a lot of various conditions but I'm having some trouble with inputs within a modal Jquery UI Dialog. When I open the dialog the first time, it works 100% fine (tooltips show up in front of dialog), but if I close it and re-open it (without reloading ...