jquery

jquery portlet - parameter for each portlet?

I managed to get the jquery portlet working on my JSP with java backend, using this example as a starting point: http://jqueryui.com/demos/sortable/#portlets for each portlet, i need to add an additional icon on the portlet header, depending on whether the user has permission on that portlet. so its something like $(".portlet").addClas...

HTML Select-Multiple Input Field = How to select/deselect (=toggle) a value with JQuery?

Hallo Experts, I have a standard "select multiple" HTML Input field als below: <select multiple="multiple" size="5" id="mysel" name="countries"> <option value="2">Afghanistan</option> <option value="4">Aland</option> </select> As this is a "multiselect", to select more than one value you have to hold the CTRL Key and selct any f...

jQuery : Chrome textareas and resize event

Chrome makes textareas resizable by default. How can I attach events to the resizing events for the textareas ? Doing the naive $('textarea').resize(function(){...}) does nothing. ...

Using jQuery to set the size of a new window

I am opening a link in a new window using jQuery: <script type="text/javascript"> $(document).ready(function() { $('a[href="/education/global-health-courses"]').attr("target", "_blank"); }); </script> I would like to set the size of the new window to 800px wide by 700px tall. I just need a little help adding those attributes t...

Next / Prev pages with Javascript?

I'm creating a online training 'powerpoint' like series of pages. It will be pretty straight forward and have the pages set out as such: page1.php page2.php page3.php ... page20.php I'll be going old school and use an iframe to hide the address bar as people shouldn't be able to catch onto the naming convention and skip ahead. (Its not...

Execute a function at the end of the last effect of a Jquery.queue

  I would like to use fx and functions I have a animation, and i would like to, at the end of the queue, do an ajax call.   I can't seem to make it work...   I have absolutely no idea how to procede... that would a very very rough example, but $('#dvHeader').queue(function() { $('#dvLeftContent').slideDown(2000); $('#dvRightC...

Jquery slide down div after an item fades in

Hey guys, this is my jquery code jQuery(document).ready(function(){ jQuery('.start_video').click(function(){ jQuery(this).fadeOut("slow", function(){ jQuery('#video').animate({ opacity: 'show' }, "slow"); jQuery('#video_stream').animate({slideDown: 'slow' },...

Jquery form : success callback called whereas form not submitted

I get a script that creates a form with an input file after clicking on a link, but when I load the function creating the form, the success callback is immediatly called. Did you get the same problem ? Here's my function : html = $('<div>'); form = $('<form method="post" action="">'); form.append('<input type="file" name="image" value=...

In Javascript or jQuery, how to detect whitespace in beginning of string?

Given the following string: htmlStr1 = " <div>This is a string with whitespace in the beginning</div> "; htmlStr2 = "<div>This is a string with no whitespace in the beginning</div> "; Is there a way to write a function that can detect if this string has a whitespace in the very beginning only? e.g., it should do the following: alert...

Latest in mobile web development best practices

I know this has been asked a bunch of times before (notably here and here), but I'm looking for a good current guide for getting started in developing websites for modern mobile browsers. Ideally, I would love an updated version of Craig Hockenberry's excellent, 2.5-year-old Put Your Content in My Pocket---one that is aware of new devic...

Funky jQuery mouseleave behavior

I have a menu-like drop down container that hides via binding the "mouseleave" event. <div id="container"> <select> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> </div> The problem I am having is when my container's child elements contain a SELECT object w...

How to remove JQuery Dialogs from the DOM

I have run into a situation where I need to manually remove old dialogs before creating new ones. In another thread, the following method was suggested: $('.ui-dialog').empty().remove(); And I think this would work, but I do have other dialogs that I do not want to remove from the DOM, and I think this method would get rid of all of t...

How to refresh a PHP database calendar after using jQuery drag and drop?

I have a calendar built using PHP, with events on it. I'm using jQuery UI to enable drag and drop to move the events around. The .droppable() function has a callback function attached that updates the database with the new information. But the calendar needs to refresh so that it reads from the new database values. Can you force a pag...

pageAnchorBuilder question - Cycle Plugin - JQuery: Changing Image Buttons

I am using the Cycle plugin for JQuery to create a banner rotator with the pauseOnHover functionality. I have it working properly and even have the pageAnchorBuilder working correctly so that it displays an image vs '1,2,3, etc. The problem is it can't find the images because I am not using images as the selector but divs. How can I ch...

easyslider show ul items only fade effect

i use the easyslider plugin in my content box. i want to only show the ul items with order with fade effect or only show hide. how can do this with this plugin (function($) { $.fn.easySlider = function(options){ // default configuration properties var defaults = { prevId: 'prevBtn', prevText...

jQuery: val() updated too late

UPDATE: there was a problem with some other code. I'm trying to get the value of some input text field. The problem is that the value I obtain by my_val = $('#MyInput').val(); is not really updated. If I write in the field 'foo' and then click on the element which triggers the script, then I get my_val = undefined. On the other han...

String case changes

Is there any String manipulation function in Javascript or JQuery for object lowercasing / uppercasing? I need to lowercase a string object. ...

execute a javascript function if the user is not active on the page?

hi, i'm looking for a javascript or jQuery function to execute my function newalert() if the user is not active on the page, ( maybe with some event to check the cursor position or something like this ) i will make it auto check using settimeout , i just want the function to check the availability of user like in gmail chat, when recei...

jQuery easing animation of window scroll in Firefox (bug or my bad?)

THE EXAMPLE First and foremost, here's my code and problem: http://www.nathanstpierre.com/MBX/showoff.html THE ISSUE So what I'm seeing is when you click the buttons on the left, the window scrolls to the appropriate heading. In every browser but Firefox (including... IE gasp) this is very smooth. However, if you reduce the height of th...

menu - if has children ->turn off links; if doesn't has children -> link on?

Hi, how do I do something like that in a menu? If has children → turn off links; if doesn't has children → link on? Can anyone help me????! :) I was trying like that: over = function(){ var $$ = $(this), menu = getMenu($$); if ("li:has(ul)") { clearTimeout(menu.sfTimer); $$.showSuperfishUl().siblings().hideSup...