jquery

JQuery: Problem in getting element's width in Chrome

Hello, Suppose I have this image: <img src="images/01.jpg" border="0" rel="shadow" /> Then with JQuery, I get its width using: $('[rel="shadow"]').width(); Firefox and IE report correct dimensions of the image eg 140px while Chrome reports 0. How to solve this problem? Note: I don't want to set explicit width for images eg: <i...

Is my slide-to-anchor jQuery routine a correct use of JavaScript, or is there a better way?

I'm currently working on a project with a one page design that'll slide up and down between sections on an <a href> link... Currently, i have it written as follows: <ul> <li><a href="javascript:void(0)" onClick="goToByScroll('top')">home</a></li> <li><a href="javascript:void(0)" onClick="goToByScroll('artistsmaterials')">artist...

Simple Expand/Collapse divs > JQuery?

I need to add some accordian style expand/collapse handles to a series of parent container divs in my application. Is this something that's too simple for a library like jquery? Example: <div class="handleDiv"> expand | collapse <div>child element</div> <div>child element</div> </div> <div class="handleDiv"> expand | collapse ...

How do I wait for "animated scroll to id" to complete before focusing on first form field?

So, I have a link at the bottom of website. When it is clicked, it scrolls to a form at the top of the page with the animated style. And as it arrives at top of page, it focuses on the first field in form. Currently, this is my code: $(document).ready(function() { $('#goto-show-form').click(function() { $('html, b...

Getting value of "i" from GEvent

Hello, I'm trying to add an event listener to each icon on the map when it's pressed. I'm storing the information in the database and the value that I'm wanting to retrive is "i" however when I output "i", I get it's last value which is 5 (there are 6 objects being drawn onto the map) Below is the code, what would be the best way to get...

In javascript, error says 'is null or not an object'. When trying to use .change() code to hide form input fields

I'm getting a javascript error. URL: http://bit.ly/dfjvmT It has to do with this section of code: /* * Activate jQuery */ $(document).ready(function() { /* * Show hidden field when 'Other' selected from dropdown */ $.listHidden = { '6' : $('.referrer_other') }; $('#referrer_select').change(function() { // hide...

php POST response

I am making a POST to another php file that I want to render in the browser. the jquery post function does not redirect to another page. it expects the app-display.php file to return data to it. have a look at the code. echo '<div class="showcase_URL"><a class="purl" name="'.$row->num.'" href="#">PROJECT URL</a></div>'; what I have...

wordpress permalinks

I set my wordpress permalink structure to /%postname%/ but now when I go to a page other than the home page (for example if I went to somelink.com/about) I lose all javascript references. I think this happens because the links to the js files are no longer right as it is in the imaginary folder "about". This is how the js files are refe...

fieldset form with Table-like layout with CSS?

I have an application in which I'm currently using a two column table in order to get accurate cell alignment of the left column labels/descriptions with the right column form fields. I'd like to convert it to css and use jQuery to expand/collapse specific sections. I've seen some jQuery libraries, the menu.js in particular. And they a...

Unexpected end of file while searching for ']' to end attribute selector.

I dont understand what would be the problem with the following code. It needs to copy image's id value to another textbox but instead I get an error. Unexpected end of file while searching for ']' to end attribute selector. <script> $(function() { $(".floatLeft").click(function() { var id = $(this).attr("id").replace(/\D/g,...

Extracting the most duplicate value from an array in JavaScript (with jQuery)

I have several array to deal with. I need to extract the most duplicate value from each array. From [3, 7, 7, 7], I need to find the value 7. Each array size is 4. For now, I don't have to think about when the most duplicate values are more than one such as [3, 7, 7, 7]. All the values are a number. I looked around the web. I found se...

Detecting position with drag-and-drop and jQuery?

Hi, I need to know how to detect the position of a dragged item as opposed to other divs. I need to detect whether an item is dropped outside of two different divs. (I am building a mac dock type start page and I need to know how to do this so I can delete icons by dragging them off the bar.) Any help would be greatly appreciated. ...

jQuery check browser css version

I want use @font-face for new browsers and use image-replacement for others... How I can check @font-face is exists in user browser? ...

JQuery, use selector to get images by their border attribute (not the css border styling)

Hey Guys, I want to round up all images that have a specific attribute and place. My images look like this: <img src='http...' border=3 class=grid_pic> And here is my attempt: $('.grid_pic:has(border=3)').each(function(){alert(1);}); But the alert doesn't shout. If I remove the has:border/has:border=3, it shouts. Any ideas? ...

attaching div to a specific element for showing with javascript

Clicking on the image should show div near it (.show() in jQuery). But how can i attach div to that image? Is it done with pure css, or javascript? I tried several "position:absolute", but can't attach it near image. How it should be done? ...

Loading the target of a link in a <DIV> via jQuery's .live event into the same <DIV>??

Hello together I call a certain div from another page with jquery to be loaded into a div on my main page like this: <script type="text/javascript"> $("#scotland").load("http://www.example.com/scotland .gallery"); </script> <div id="scotland"></div> The div I call is a piece of code which is automatically generated by a CMS made simp...

jqGrid Filter Toolbar initial default value

I'm using jqGrid with the filter toolbar, i need to set an initial default filter value to one of the fields so that only rows with status 'Open' are displayed by default, but the user can display Closed rows if desired. At the moment i have a workaround like this setTimeout(function() {$('#gs_Status').val('Open');$("#eventsGrid")[0].t...

Having a hard time implementing jquery serialScroll to a website. Need help!

Here's the page I am attempting to implement it on. www.yosoh.com/2010/advertising/beyond/ I have a custom script with figures out the width of all the images, adds it up, then sets the width of that page... I'd like to be able to set the arrows at the top to scroll to the next div (div.portfolioImage). I've followed Ariel Fischer's d...

How can I add a tab in jquery-ui Tabs and then select it?

I understand how to add a jquery-ui tab, and I understand how to select a tab by index number, but how can I both add a tab and then select it? For example, in the following demo you can add a tab, but then you have to click on it for it to be displayed: http://jqueryui.com/demos/tabs/#manipulation I'm on jquery 1.4.2 and jquery-ui ...

jQuery DatePicker - 'fake' click on page load

Hey! I've got a quick question about the jQuery UI DatePicker. When I load the page, defaultDate: 0 will work fine with selecting the current day's date. I would like to create a 'fake' click on the date so it will execute my JavaScript function and retrieve information from the database. I tried calling the function when the page load...