jquery

This doesnt appear to work - count text length

This jQuery doesnt appear to be working as I would expect it to: $('#topic li a').filter(function () { if ($(this).text() > 410) { $(this).parent('li').addClass('wrap'); } }); The jQuery should work out if the text within an <a href=>....</a> is over 410 chars, if it is it should add the class .wrap to the parent li. Anyone h...

IE 8, object required javascript function

Hello, I have been looking all the day about my strange problem. I have a page, which is loading dynamically content via ajax (with jQuery), but I think it's not a jQuery problem. The dynamic page contains a javascript function, let's call it "myTestFunction()", without any parameters. After document.ready (jQuery) or at the end o...

jQuery appendTo HTML not selectable when added to a Google Map

Hey all, im having an issue with Google maps and jQuery appendTo(). Im using the following to create and attach a custom infoWindow to Google markers. $("#message").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE)); The following would also work ... $("#message").appendTo(map.getPane(1)); This attaches itself within the right DIV as ...

Javascript Onclick

Hi all I want to achieve a very simple effect to scroll divs when pressing an arrow button ... How do i do this? Basically i have a maximum of 4 divs named: Slideframe, slideframe1, slideframe2 and slideframe3 I have a PHP variable called count which generates the slideframe content based on a PHP loop which increments a variable cal...

width change with jquery show()

I have a jquery code to expand/collapse hyperlinks and when i am using css width 350 px for both title and description. But when i click on expand the title is getting shrunk. I am not really sure why it's happening only for title but not for description. Plz see the screenshot below. Thanks, ...

Change div background image with jQuery

Hey guys, I'm trying to change the background image of multiple divs with the class .innerpreview when a drop down selection is made. Any idea why the following isn't working? $('#txtMontage').change(function(event) { if (this.value == "example") { $('.innerpreview').css('background-image', 'img/img-bkg.jpg)'); } }); T...

jQuery, passing success data from AJAX to another function?

I'm trying to get the success data from a jquery Ajax call so I can use it elsewhere but for some reason its only accessible within the actual success call, so immeditaly below works but the other doesnt'.. any advice is appreciated success: function(data) { alert (data) } this doesn't work when I try to pass "data...

jQuery - do something after an element is loaded via ajax, but not in the ajax function

I'm trying to watch for an element to load on the page from an ajax call. I don't have access to the jquery that's making the ajax call. So, when some new html is loaded onto the page, I'd like to apply some changes to it. I'm currently trying to use the .load() function: $( '.autosuggest_keyword' ).load( function() { ...

jQuery live handler but for each()?

I know that live() can be used to support event handlers for current AND "added later" DOM elements. I wonder how to do the same thing with each()? Like if I have $('.something_or_other').each() but then another DOM element with class="something_or_other" gets added? How can I set it up to automatically apply the each iteration to this...

How to show 5 records in 5 different <DIV > tags using jquery PHP Mysql with Next /prev button

Hi, I have html page whicha has 5 Div tags in disable mode. what I want is Imagine I have 200 records in mysql database table Using Jquery I want to call PHP Mysql data (only 5 records at a time) When user clicks on Next button PHP page will get called Limit 6, 10 and so on if user clicks on Prev button then previous 5 records ...

How i can make json child nodes (JSON inside JSON)?

I try to use the jquery + json to get all elements in form and build a JSON var to post in a ASP.NET MVC method. $.fn.serializeObject = function () { var o = {}; var a = this.serializeArray(); $.each(a, function () { if (o[this.name]) { if (!o[this.name].push) { o[this.name] = [o[this.name]]; } o[this.name].pu...

Drag and Drop Element Into Textbox

In the latest project I'm undertaking, I need to be able to drag a div element from a list and drop it into a textbox. The project itself has a strong messaging component and I'd like to have the functionality to drag contacts from a contact list and place them in a "recipient" textbox containing one or more recipients, comma delimited. ...

jQuery Dialog window won't open

I'm not usually one to just post code and say "help", but I feel like I've exhausted every search. Any help as to why this doesn't work would be greatly appreciated. I'm not getting any type of Javascript errors, the window just doesn't open when I click on the link I set up. function openDialog() { jQuery('#GREWaiverTable').show();...

can you set value of element in .live function?

Bit of a long winded question but here it goes- I query a database and then return the values in a html table. The number of rows and columns in the table depends on the results of the query. I want the user to be able to get more information on each row. To do this the user will click one of a choice of images in the last column of eac...

Progressive Enhancement and Initial Display State

I have a specific example, but I'm looking for the answer in general as well. I have page elements that I want to have initially hidden if JavaScript is enabled. Examples: A section of a form that toggles A submit button for a select box 'jump form' I am trying to avoid the 'content flash' when the elements are hidden after page lo...

Horizontal Drop Down Menu

Hi I want to create a html structure like this: <ul class="menu"> <li class="top"><a></a></li> <li><a class="button1"></a></li> <li class="extend"> <a class="button 1"></a> <ul> <li class="last"><a class="button2"></a></li> </ul> </li> <li class="extend"> <a class="button1"...

What's the syntax for using += with a variable when using the .animate function in jQuery

I'm trying to animate the right margin of an element using += to continually add to the margin each time the function is called. I want the value to be a variable though and I can't figure out the syntax. Here's what I have: $('.wide')animate({"right" : '+=320px'}, scrollSpeed, scrollEase); And that works but here's what I'm trying t...

datatable styleing css

I want to style my datatable using ThemeRoller . already enabled jQuery UI ThemeRoller support in my datatable. I have only one row on the top and the Pagination numbers are styled fine. but i dont see any style on the rows, they are all the same. Is that the default setting or i am missing something. $(document).ready(function(){ $("...

jQuery selector vs filter()

Given the following markup <ul class="list"> <li>first item</li> ​<li class="item">second item</li> <li>third item</li> </ul>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ Which one these 2 expressions is better to select the second li? $("ul li.item") or $("ul li").filter(".item") This is not ...

In jQuery's ajax success callback, will textStatus ever not be "success"?

In the documentation there is a list of possible values that textStatus might be if the error() callback fires ("timeout", "error", "notmodified" and "parsererror") but nothing specified for the success() or complete() events. Are there any other values besides "success" that could be passed to the success() callback? Is this documented...