jquery

Switch case in jquery

Am I writing the correct switch case? var cnt = $("#div1 p").length; alert(cnt); switch (cnt) { case (cnt >= 10 && cnt <= 20): alert('10'); break; case (cnt >= 21 && cnt <= 30): alert('21'); ...

jQuery Flow Control (if then from URL params)

Strangely enough I am more familiar with jQuery than I am with javascript. I need to be able to add a class to the body tag of a document depending on what specific forum page i'm on in a phpbb forum. Due to the nature of phpbb I can't actually do this flow control in php, so I am using jquery. Here's my code (the first part is an ex...

JQuery: How do I determine if a slideToggle has been toggled?

How do I do the following pseudo code in JQuery? $(document).ready(function(){ $(".btn-slide").click(function(){ $("#divToSlide").slideToggle("fast"); if ($(this).isToggled) { // <---- DOESN'T WORK ------- // do something when toggled } else { // do something different when not toggle...

jquery post and get request different on local intranet and live server

Hi, I have been developing an asp.net mvc application where i need to make large amounts of jquery post and get request to call controller methods and get back json result. Everything is working fine. The problem is i had to write different jquery post and get request url on local intranet(deployed by making virtual directory) and liv...

JQuery: How do I use the JQuery delay with my own function?

How do I use the JQuery delay in conjunction with my own defined function, pseudo-code like so?: $('#foo').slideUp(300).delay(800).myOwnFunction(1,2,3); function myOwnFunction (a,b,c) {...} The code above doesn't work, however - per the JQuery documentation it appears like it should. ...

JQuery: How to use an HTML ascii arrow for a toggle indicator?

I came across this great JQuery example of using a slidetoggle. I want to implement it exact as is, except for one thing. The example uses an image for the Up and Down (white) arrow indicator. Can't I use the HTML ascii up arrow () and down arrow () instead of using an image. If so, how? ...

Simple question: How to change div title using jquery

I have the following code: <div id="DivPassword" title="test" > I want to change the div title and I have the following code: function ChangeAttribute() { $("#DivPassword") .attr('title', 'Photo by Kelly Clark'); $('#DivPassword').dialog('open'); return false; } When the dialog is op...

Using Jquery .ajax method how can i read the query parameter and hit the web method and get the result in json on page load + asp.net?

hi, I am using Asp.net with jquery I wanted to display information for a specific product that is getting from the query string so my question is How can i get the query string through jquery and hit the Web method and get the result in json and display that result on my page on page load. Thanks waiting for your replay.. ...

How to add dimensions to dynamic img elements (Updated)

I use a Json call to get a list of image addresses, then I add them individually to a div like this. Unfortunately the image dimension is not part of the Json information. <div id="container"> <img src="A.jpg" alt="" /> <img src="B.jpg" alt="" /> ... </div> Do any of you JQuery geniuses know of a code that would flawlessly an...

Adding Jquery functionality on PartialView load

How can I attach jquery on an ASP.NET MVC partial load. I've a form rendered in a partial that has some jquery attached, but that code is not running at all ...

how to perform click to the output of ActionLink by jQuery or javascript?

<%= Ajax.ActionLink("Edit", "Update", "Home", new { id = item.mID }, new AjaxOptions { OnBegin = "function(){ $('#edit" + item.mID + "').show();}", HttpMethod = "get", UpdateTargetId = "edit" + item.mID })%> The above code generates the html source code. when user click the link, it works well. But there're so many links there, I must ...

Get number of checkboxes that are checked in Javascript

I am trying to make a javascript function (although jquery is perfectly OK) that will return a number that corresponds to the number of checkboxes checked in a form. Seems simple enough but I can't figure out a good way of doing it. Thanks. ...

Internet explore is unresponsive while loading a large page

We have a html page being rendered in the browser (IE) that causes the browser to hang. The page is generated through server side script (ASP.NET and viewstate is disabled). The page while loading takes a long time (its not a b\w issue since we can reproduce it on local machine) and sometimes results in script unresponsive error. On deb...

Searching for a jQuery Datepicker

Hey Guys, i hope you can help me. I'm looking for a "special" Datepicker JS/jQuery which needs some special Options: I'll try to explain you with the help of the jQuery UI Datepicker - the same function as the Inline Datepicker - 2 Datepickers has to be shown at the same time - it should be possible to disable Dates !!!!!!!!!!! (thats...

increase number of photos from flickr using json

Hi this is my code: Is is possible to get more photos from flickr. What is the standard / default number? $(document).ready(function(){ $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id=48719970@N07&amp;lang=en-us&amp;format=json&amp;jsoncallback=?", function(data){ $.each(data.items, function(i, item){ ...

execCommand for font-size causes problem in Google Chrome

I am using a jquery based rich text editor "lwRTE" It works well in all ways except in changing fontsize I traced the problem as follows: when i change the font size the command and the argument is chosen correctly as "font size" and "[the font size in number Eg.6]" now the execCommand is executed and chrome executes it differently. ...

jQuery - How can I override a background color animation with hover?

I am new to jQuery and need some help with the following problem. I have a simple table of data (20 rows by 4 columns) on a webpage (asp.net mvc). Note - I have built the table using <div> tags and not <table> <td> <tr> tags. For each row there is summary data and then the option to click 'Edit Record' on the right hand side of the row...

Jquery Superfish menu - How to slide up?

This is the jquery code for superfish menu plugin (after some revisions of mine). I'm looking to add an effect (either through superfish or adventitiously) that would cause the submenus to slide up on mouseout (just as they slide down when you hover a menu-top). jQuery("ul.sf-menu").supersubs({ minWidth: 12, ...

How can call a jQuery function when it is inside the formview (asp.net control)?

Hi, All I have a Span in side the Form view. I wanted to Call a Jquery Fucntion when the from load how can i do this? Thanks Waiting for your reply here is my code <asp:FormView ID="FormView1" runat="server" OnItemCommand="FormView1_ItemCommand"> <ItemTemplate> <asp:HiddenField ID="hidProductID" Value='<...

Accessing web Service from jQuery - cross domain

Hi I am trying to acess a wcf service from a jQuery client Specifically this example http://www.codeproject.com/KB/aspnet/WCF_JQUERY_ASMX.aspx#4 All works well when the client webpage is on the same domain as the service As soon as I move the client webpage to another domain it breaks. It cant reach the service and the request fails ...