jquery

preventDefault not working in IE

Hi, I am trying to submit a form with ajax, the form itself is loaded via a ajax event The following Jquery code works in FF?chrome. In IE, the form submission is not prevented $("#admin_main").delegate("#create_user_form", "submit", function (event) { if (event.preventDefault) { event.preventDefault(); } else { ...

How to unbind event handlers that were bound via jQuery without using jQuery

Say I have the following jQuery: $('#myelement').bind('click', foo); How can I unbind this event without using jQuery? The event doesn't show up in any of these methods on a DOM element: var domElement = document.getElementById('myelement'); domElement.onclick // == null domElement.click // == undefined So how can I unbind it with...

How to check if an event handler exist using jQuery or JS?

I want to check if an event is available or not before binding a function to it. The problem is that Google Chrome support the event "loadedmetadata" in the Video element while FireFox don't. I did the following $('video').bind('loadedmetadata', videoloaded); videoloaded(); It worked well in Firefox but when I tried in Chrome, the fu...

Animate backgroundPostion always returns 50% ?

I'm trying to do a very very simple mouseover that animates a change in background position. js $('li.services_w') .css( {backgroundPosition: "0px 0px"} ) .mouseover(function(){ $(this).stop().animate({backgroundPosition:"(0px -35px)"}, {duration:500}) }) .mouseout(function(){ $(this).stop().animate({bac...

Image transitioning jquery

At the moment I'm developing a site and this is my first project using jquery. I'm using jquery to handle the calling of the images, but at the moment I'm not really liking how it is handling the transition from one image to another, the previous image which is about to be replaced is moved shifted due to the change of width to the image...

How to check if a user has scrolled to the bottom

I'm making a pagination system (sort of like Facebook) where the content loads when the user scrolls to the bottom. I imagine the best way to do that is to find when the user is at the bottom of the page and run an ajax query to load more posts. The only problem is I don't know how to check if the user has scrolled to the bottom of the ...

Sencha Touch vs jQueryMobile

I know jQueryMobile is not out yet. Anyone knows which mobile dev environment (create once-render on any mobile device) is more promising? ...

JQuery .xml keyword add-on for Notepad++

Hi! Still have the JQuery keyword xml section for Notepad++? I'm a newer user and it would really help! Thanks! [email protected] ...

Get URL param/segments conditionally (JS/jQuery)

I'm using an external jQuery url parsing library http://github.com/allmarkedup/jQuery-URL-Parser to grab url segments for GET. The URL's i'm working with include one of two formats: http://example.com/#name or http://example.com/?name=name Depending on the url im getting fed back, I want to use the url parsing library to construct a ...

How do I extract a substring from a string in Jquery

Hi, I want to write a message in a textarea and be able to refer to a person using the @ symbol. e.g Please call @Larry David regarding something When submitting the form, I want to extract the persons name ie Larry David. How do I go about extracting this string with Jquery? ...

Observe Form Submit

I use this to invoke a function when a form on the page is submitted: $$("form").invoke("observe", "submit", submitForm); I'm having a problem getting this to work in IE when a text field has focus and the enter key is pressed. Firefox submits the form in this case but not IE. The form has one submit button: <input type="submit" va...

How to toggle the refresh of another table element

I am not sure how this is referred to, but I am trying to toggle the view within a table element. To analogize, say I have a table cell that displays two icons, one for displaying files by icon and a second icon for displaying files by list. When either of these icons are clicked, they should refresh another table cell accordingly. If...

links not active in show toggled Div in jQuery

I have a menu div which shows/hides based on click with jQuery, but none of the links are active when you put them in .. ideas? I only have one item in the list that is a hyperlink. Once I can get it to work, I'll add it to the rest of the items .. however that one link doesn't work. jQuery $(".sign_in").click(function() { $(...

jQuery - Given an animated Background-Image - How to keep the position on page reload?

Hello, I have a background image scroll on a DOM element. This works great, but when the user clicks a link to load a new page, the background image scrolling starts back at its original position... Any clever way of making this appear more continuous so it's not jumpy? I thought about a cookie, but was concerned that would be writing m...

jQuery UI Autocomplete with Categories

I'm using jQuery UI's Auto Complete to provide suggestions from a remote source for a search input box. I've got the "remote datasource" example working. For example, this works: $("#search").autocomplete({ source: "search_basic.php", minLength: 2 }); However, I'd like to use the "Categories" example to sort ...

How do you create a jQuery plugin?

I have the following code, which I am following from the jQuery documentation on how to build a plugin. I'm just trying to create a simple isNot extension: (function ($) { $.fn.isNot = function (selector) { return !this.is(selector); }; })(jQuery); $(document).ready(function () { $("#someButton").click(function (ev...

jquery - setting the url after the hash

I'd like if I could click a link with class "query" and have it's id attribute come after the hash. For example, a link that looks like this: <a href="#" id="members" class="query">Members</a> When clicked would change the url from example.com/users to example.com/users#members. Here's my code so far: $('.query').click(function(event...

Using jQuery and sprites

I am looking for a way to animate my sprites with jquery. When I hover over the image, it fades in. then when I hover off. it fades out. CSS: nav ul { position: relative; z-index: 1000; margin: -26px 0 0 11px; overflow: hidden; } nav ul li { display: inline; } nav ul li a { background: url(../images/nav-sprite.png); display: block; f...

jQuery Javascript loading continuously in CodeIgniter

Hi all, I am developing one application using PHP, jQuery, Javascript in CodeIgniter. I included script.js file in view file. The problem is the view file is continuously loading again and again with in the result div called "new". Please help me. Below are the files and code. View file <?php $this->load->view('header'); ?> <scrip...

Refreshing images on a page periodically

Hi, I'm building a page to display a bunch of webcam images and update them periodically so that the page can be used for at-a-glance monitoring. However, I'm having issues getting the periodic reload working. My code looks something like: <div class='cameras'> <div class='camera'> <h4>Desk</h4> <img height='240' src...