jquery

Superfish to open an option "onInit"

On some of my pages I want Superfish (menu plugin) to unfold one of the first level options by default as soon as the page opens. I attributed this option ul an id="me", and trying to implement "onInit" function, but it does not work. Could someone please look? Thanks. jQuery(function(){ jQuery('ul.sf-menu').superfish({ onInit: functio...

simple question about jquery selector

for example, if I have: var $target = $("div#target"); and then, I would like to pass this jquery object $target to another javascript function I defined myself, like: function f(xml, $div_t) { } inside the function f, is there someway I can retrieve the original div's ID from the object $div_t? ...

How can I build a filterable jquery slider for a portfolio?

I'm trying to create a filterable portfolio using a jquery slider, using easySlider and code I have adapted from various tutorials. The portfolio items are rendered as an unordered list, and shown or hidden based on their css class. I've managed to get this part working properly, but I can't work out what to do about the slider. It no lo...

jquery hiding works in .live and fails in .ready

Both of the below functions (which are identical except for when they should run) are in $(document).ready. The .live version works as expected, hiding 2 divs when the selector is checked and showing them when it is unchecked. The .ready version does nothing but it is supposed to hide the specified divs when the page is loaded. The chec...

.toggle() doesnt work, executes both.

This function below works in static pages but in dynamic pages it doesn't work correctly, it executes both functions when clicked the first time. and when tested with firebug (or jsenav ) it does work correctly $(document).ready(function() { $(".toggleShipingSched").toggle(function(){ $(this).html("close schedule").addClass("op...

Ajax.Actionlink output with id attribute

Hi everyone, I'm using the Ajax.Actionlink from the MVC framework and everything works fine with my targets and partial views. However I've seen that the html output doesn't add the "id" attribute to the resulting tag. Is there any way how I can add it? Thanks in advance ...

jQuery MultiFile - how to clear / reset ?

Hi all, I'm using the jQuery multi-file upload plugin found here: http://www.fyneworks.com/jquery/multiple-file-upload/ I don't see in any of the examples though a way to "reset" the file-picker, clearing out any currently selected items. Any one know how to do this? Thanks! ...

jQuery: How to get the closest value when a button is clicked?

I can't seem to get this code to work. How do I get the closest value of .abc when the button is clicked? Defining Closest ie: if you click the button where "A:" is at I want a value of 10. if you click the button listed in "B:" I want the value of 20. Here is the code: <script type="text/javascript"> $(function(){ $('.test').click...

Issue with JSON and jQuery Iteration

I'm pretty sure it's an obvious error somewhere on this - but let me explain what I'm donig : I'm calling a PHP file via jQuery as follows : $.getJSON("/phpincs/getbucket.php?awskey="+awskey+"&awssecret="+awssecret+"&bucket="+bucket, function(json){ $.each(json,function(i,item){ $(new Option(item.name,item.name)).appendTo...

how to tell is user selected the first index in a combobox in javascript

i have this code: $('#categories').change(function() { var myCars = new Array("Saab", "Volvo", "BMW"); addRowToTable(this.value, myCars); $('#listings').hide(); }); but i dont want it to call the addRowToTable method if the user selects the first item because the first element says "Plea...

jQuery: change icon to greyscale

hi all, i made a button widget in jQuery which displays an icon. now when i set the button do disabled, i'd like to have it greyed-out. is there a jQery function to do this? thx ...

jqgrid catch server error when deleting row/s

got this code: $('#hotels').jqGrid({ url : base_url + 'administrator/ajaxhotel', datatype : 'json', mtype : 'GET', colNames : ['Hotel ID' , 'Hotel Name', 'Hotel Location','Type', 'Status', 'Active', 'Date Added'], colModel : [ {name: 'id', index: 'id'}, {name: 'name', index : 'name', edi...

Manipulating the "data" from $.ajax success: function(data) {....

Hello, i have this and a simple question to it. $.ajax({ type: "POST", url: "/", data: $(".form").serialize(), dataType: "html", success: function(data) { $("#id").html(data); } }); Inside "data" is some html I am inserting into the DOM. Thats no problem. But I want to manipulate the "data" before doing so. How ...

How to assign an Ajax success handler when loading jqmodal dialog ?

Hi, What I need is very simple but, searching the web, I didn't find any example. I am using the jqModal jQuery plugin for displaying content dynamically (via Ajax) in a modal dialog. Once, this modal content is loaded, I need to bind some event on the dialog DOM elements. Therefore, I would like to assign an handler to the "success" A...

Wordpress Multipart Form

Hi, I'm trying to set the wordpress posting form to multipart/form-data for a custom write panel. I am attempting to use JQuery but can't seem to get it to work. jQuery(document).ready(function(){ jQuery('form#post').attr('enctype','multipart/form-data'); jQuery('form#post').attr('encoding','multipart/form-data'); }); This is...

Pausing For Loop jQuery question

Hello, I have an issue with javascript/jQuery...I have a web service that will process information from a list from the client. What I want to do is have the client send the data piece by piece allowing the web service to do its job without being overloaded. Also I am using a jQuery UI progressbar which will allow the user to see the pr...

Dynamically including javascipt files only once

I have a javascript function I'm writing which is being used to include an external JS file, but only once. The reason I need such a function is because it is being called when some content is loaded via AJAX and I need to run page-specific code to that content (no, just using .live won't cover it). Here's my attempt, shortened for brev...

jQuery help ...

MAIN WINDOW // some javascript //some html //here ajax-call to load all divs //all divs hidden by default //based on user choice(from select option), show selected group of divs //click any shown div to call corresponding popup POPUP WINDOW //edit contents of that div. //on close i need 1. refresh main window to load all divs 2. sele...

TinyMCE - How to add a button that wraps selected text with a tag

I'm currently using TinyMCE and would like to add a custom button that works as follows: User highlights text in the text-editior User clicks the custom button X The text (dog walking) is wrapped with a tag (dog walking) Any ideas on if this can be done? I've figured out how to make a custom button inject text, but not wrap text... H...

Find the ID of the window which generates alerts

Hi all: Is there a way to find out the id of the IE window that generates alert boxes? I assume it is the document or window itself. Either simple html or jQuery can be used. I tried something like: var id = $(this).parent().attr('id'); but to no avail. Ultimately I want to find out the ID of the window/document which generates j...