jquery

jQuery - Add click event to Div and go to first link found

Hi guys, I think I've been too much time looking at this function and just got stuck trying to figure out the nice clean way to do it. It's a jQuery function that adds a click event to any div that has a click CSS class. When that div.click is clicked it redirects the user to the first link found in it. function clickabledivs() { ...

Resize image to 100% height of a div and keep aspect ratio

Here is a quick sketch. I would like to achieve that images in the gallery div will be 100% of the height of the gallery div and keep the aspect ratio AND that images would resize as you would change the size of browser. Is this possible? Any help would be much appreciated. Here is what I made so far: www.nulaena.si/photob/. ...

jQuery if something is more than value then hide and add a button to show whats hidden?

Hi guys! Exactly what my title says is the problem Im having right now. Im checking a div for how many links php printed and if there is more than 10 Id like to hide them and add a button that says read more and then it show the rest of the links. $(document).ready(function() { var newsRss = $('#rssNews >li').length; ...

Why jquery.animate on a textarea make the blinking cursor disapears?

Hello everyone. I have the following code $(document).ready(function() { $("#myTextArea").focus(function() { $("#myTextArea").animate({ "height": "75px"}, "normal"); return false; }); to expand a textbox when it gets focus. The expand occurs, however the blinking cursor disapears, at least in Firefox! Edited:...

Insert random <script> for using $(document).ready(function()}); in Joomla

Hi I have an article in which I use PHP code inside the text editor in Joomla, in the backend. I can see jQuery already called when the page loads, here is my code inside the Article edit textbox: <?php $username="XXX"; $password="XXX"; $database="XXX"; mysql_connect('localhost',$username,$password) or die(mysql_error()); mysql_select...

JavaScript/jQuery removing character 160 from a node's text() value - Regex

$('#customerAddress').text().replace(/\xA0/,"").replace(/\s+/," "); Going after the value in a span (id=customerAddress) and I'd like to reduce all sections of whitespace to a single whitespace. The /\s+/ whould work except this app gets some character 160's between street address and state/zip What is a better way to write this? this ...

Calling a MVC2 partial view using jquery returns empty string problem

I have an issue where I have a partial view that returns some HTML to be displayed. Its called when something is clicked on the page using jquery. The problem is that no matter how I call it, i get back an empty string even though it reports success. This is happening to me using Chrome, going against my local machine. My controller loo...

How to jQuery slidedown once page has already been loaded

I am having a timing issue when attempting to slide down my more info div. My desired functionality is that the div slidesdown from the top once the page has already been rendered. My problem is if I use $(document).ready().. the animation does not visibly occur. Here is my code: $(document).ready(function() { $(".MoreInf...

JSON Response {"d":"128.00"} but displaying "128"

Hi all, I have been working on a shopping cart that the user can add/remove order items as they please and am returning an updated sub-total via a webservice using jQuery $.ajax Here is how I am calling the webservice and setting the sub-total with the response. //perform the ajax call $.ajax({ url: p, data: '{' + s + '}', ...

Parent selector in jquery

I have a table row that needs to be hidden when the anchor with class "removerow" is clicked. <tr><td>Product Name</td><td><a class="removerow">Remove</a></td></tr> I've been trying this, but it doesn't work: $("a.removerow").click(function(){ $(tr > this).hide(); }); How can I select the entire table row with a child of ".remover...

jquery ajax encoding problem!

hi, i send ajax requests with jquery, and i have a function: $('input').ajaxSuccess(function(e, xhr, settings) { console.log(xhr.responseText); }); Ajax response ara russian letters in utf-8, all server (apache, php) and files are in utf-8 but response text is something like this: \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c...

Jquery Datepicker with XML file

an extension of my last question, http://stackoverflow.com/questions/2562986/getdate-with-jquery-datepicker , I am trying to use the jquery datepicker to load specific info from xml file dependent on the date selected by the user. Similar code but i am trying to load and parse an xml file to read contents of the file for the particular...

Referencing the current jQuery object in a chain?

At DevDays in SF last year (before jQuery 1.4 was released), I thought they mentioned an upcoming feature in 1.4 that would allow you to reference the current jQuery object while in a chain. I've read through all of the 1.4 improvements and wasn't able to find it. Does anyone know how this can be done? Example Being able to access the ...

How do I disable or enable 2nd dropdownlist in aspx based on selected choice of the 1st dropdownlist box

I am having a problem with disabling DropDownList based on the chice of 1st DropDownList, there is no post back occuring, and it is a template based web app here is the current code: <script type="text/javascript"> $(function() { var dropDownList1 = $('#<%= ddlUserType.ClientID %>'); var dropDownList2 = $('#<%= ddlMember.ClientID %>...

The simplest tabs with history - back button

I looking-for the simplest tabs with history back button, but without ajax-loading files/content, like as slide divs. ...

Detecting presence of a scroll bar in a DIV using jQuery?

I want to detect the presence of a scroll bar in a DIV using jQuery. I was thinking to use $('div').scrollTop() but that returns 0 in both cases when the scroll bar is at the top and when there is no scroll bar at all. Any ideas guys? ...

Modify POST vars before post, using jQuery

I have a form, and a submit handler in jQuery. When the user submits the form, I want to modify (add) some parameters to the POST request, before it is despatched from the client to the server. i.e. User clicks 'submit' My jQuery submit hander begins execution... I create some new key/value pairs and add them to the POST payload At...

How to determine if variable is 'undefined' or 'null'

How do I determine if variable is 'undefined' or 'null'. My code is as follows: EmpName = $("div#esd-names div#name").attr('class'); if(EmpName == 'undefined'){ ///DO SOMETHING///// }; ...

Hover function for accordion

Thus far you guys have been wildly helpful with me getting this little ditty working just so. I have one further request: This markup: <div id="themes"> <h2>Research Themes</h2> <ul> <li class="tier_1"><a class="enviro" href="">Learn about our approach to the <strong>environment</strong></a...

jquery cycle plugin - need some help with the pager...

I'm trying to implement the pager and I've gone through the samples on that site as well as some of the solutions posted here in response to similar questions and elsewhere on the net, but so far nothing has worked... This is the jquery I'm using (the latest attempt anyway...). I'm sure that the html markup is probably not accommodat...