jquery

How to resize ONLY horizontally or vertically with jquery UI Resizable?

The only solution I've found is to set the max and min heigth or width with the current value. Example: foo.resizable({ maxHeight: foo.height(), minHeight: foo.height() }); But this is really uggly, specially if I have to change the elements height progammatically. Sorry for my bad english, thanks in advance. Diego ...

how to get the selected index of a drop down

I have a normal dropdown which I want to get the currently selected index and put that in a variable. Jquery or javascript. Jquery perfered. <select name="CCards"> <option value="0">Select Saved Payment Method:</option> <option value="1846">test xxxx1234</option> <option value="1962">test2 xxxx3456</option> </select> ...

3 Column CSS Equal Height jQuery solution

Hey, I was working on a solution to my equal height three columns CSS equal height layout with jQuery, because the CSS workarounds were really giving me some trouble. I came up with the following code: $('.columns').css("height", "$('#detail').height()"); But for some reason, I don't see any effect when I reload my web page. I even ...

Is it possible to work out where in a p's text a mouse click event occurred?

I have a <p> containing text. When the <p> is clicked on, I create a <textarea> containing the text from the <p>. Is it possible to calculate where in the <p>'s text the click occurred, and move the <textarea>'s cursor to that same point? ...

jQuery AJAX() method just want to send a value in a php file

i use this code : $(document).ready(function() { $.ajax({ url: 'server.php', type: 'POST', data : {temp : '100'}, success: function(data) { alert('Load was perfo...

clone & live function with context parameter jquery 1.4

Hi, I have few div HTML elements and i am cloning it with a clone(true) option as i want to copy the events also. Now the case there are certain click events in my HTML div blocks and while crating events i use context parameter also like var $block ="<div class='task-create-content' >"+ "<div class='task-create-previ...

how do i get the id of the a href which is dynamic in nature in jquery

i have the table of rows which are dynamic in nature from server side script (PHP) so each and every first td in the row of every table will have the context menu (jquery plugin) applied . How do i get the attribute id(which is dynamic in nature) of when ever the first item of context menu is clicked $("#mytable td:first-child...

jQuery page transition and browser history

Hi, I'm working with jQuery to have a fade-in effect on my html page, which works just fine. However, when I hit the back-button in my browser, I go to the right url but get a blank page. Is this a browser-caching thing? I'm relatively new to jQuery and I'm not really sure how to solve this. This is the site: http://www.e-preview.be/huyz...

history.back(); doesn't trigger $(document).ready();

I have a webpage that use $(document).ready() to build the interface. Then the user can go to a child page, and to go back to the original page he can press the browser's "previous" button or a "Return" button in the page which triggers a history.back();. Back on the original page, $(document).ready() is not triggered so the page is miss...

Javascript: adding the print function to the body element

I need to implement a print page functionality with the following restrictions: i cannot have a print view (no print.jsp to point to) i cannot rely on print.css alone (because i have to move stuff around a lot in the DOM to get the page i want to print) So i implemented this little script that can help clarifying where i'm going with...

The most common shortcut in Textmate doesn't work?

The shortcut for jumping to the beginning or end of a line of code with ⌘ + -> or ⌘ + <- does not work. I just get a mac os x system beep. I believe this shortcut is universal to the mac os x platform, and not specifically TextMate, and it and it does work everywhere else (TextEdit, StackoverFlow, etc.). Why would TextMate conflict wi...

How do you use a JSON string or JSON object with jqGrid?

My jqGrid is work when my JSON data is in a static file, but if I copy the data to a var and then try to load the var into the jqGrid's url it doesn't show. Can you pass a string into jqGrid e.g. This works: function GetJSON() { var jsonFile = "EntityWithChildren.json"; return jsonFile;//returning a file works fine. } $("#jso...

Fixing scrolling behaviour with jQuery

So I have a page that is split into 2 columns. The left column there are expandable forms that are quite long to ask the user optional product preferences. On the right side of the page there is a much shorter, 'contact details' form. The contact details form is mandatory. The behaviour idea is that as the user scrolls down to complete ...

change TextBox text after button click in Facebox plugin

Hello guys, I have a problem: My facebox has a button and textbox(asp.net server controls) I want when i click the button to change the textbox text here is my aspx code: <div id="FaceDiv" style="display:none" >I'm your facebox<br /> <asp:Button ID="ShowButton" runat="server" Text="Show text" OnClick="ShowButton_Click" /> <asp:...

Setting a select value

Hey all, Is there any way to set the value of a select and have it act as if it was changed by the user? I used $(document).ready(function(){ $('#department').change(function(){ $('#academicbody').hide(); var selected = $("#department :selected").val(); $('#progrmmehome').load('/email/programmelist/'+selecte...

Tracking image views in Fancybox (a jQuery Lightbox) using Google Analytics

I am working on this site: http://www.vomero.co.uk/Torquay.aspx and would like to track views of the images (which open in a Fancybox gallery). I know I could add an onClick event to each image, but since the gallery allows the user to view all the images using Next/Prev icons it is unlikely users will actually click each photo. Any id...

how to get data from external url in Jquery

var resturl = "http://example.com"; cj.getJSON( resturl + "&callback=?", function(data){ console.log( data ); } ); My callback function is never called. Any idea?? ...

Why does this javascript (jquery) function seem to run out of order?

I'm having a nightmare with a simple function! I want it to: read the height of a div with existing content in it Update the div with the new content (supplied to the function) Read the height the div should be, but set it to the original height. Animate the div's height to adjust and fit the new content. Code is as follows: // fun...

Sorting items in JQuery on a variety of attributes ...

I need to give users the functionality to sort a list of products based on several pre-selected field names. The products list is structured roughly like ... <span class="productList"> <div class="product"> <p><strong class="sortName">Title</strong></p> <p>Weight: <span class="sortWeight">3.50</span> pounds</p> <p>Price: <span ...

access a single object in a returned collection (jquery)

Okay, if I have a html document that looks a bit like this: <div class='item'> ... </div> <div class='item'> ... </div> <div class='item'> ... </div> <div class='item'> ... </div> I know I an iterate over them by doing $('.item').each But what if I already know I want to do something with the second one? Is there some sort of synta...