jquery

Jquery/Javascript drag and drop one parent to another

Hi, I've been playing with JQuery UI draggable and have been struggling with maintaining element position when dragging an element from one parent to the other. As soon as move the element to another parent it's positioning is way off. I then proceeded to workout the offset and applied it to the element and it worked very well until I...

Jquery:(under 10 lines) when body.scrolltop > this 'h2', fade that h2 out, when it's not, fade it back in.

When the top of the body window is greater than or equal to the h2 tag, fade the h2 out, if the top of the window goes back up above that h2, fade that h2 back in. This code will fade out each individual h2 as you pass it scrolling down, but when i scroll back up, it wont fade it back in, and i'm not sure what i'm doing wrong. i'm not t...

Problem with each()

<script type="text/javascript"> //<!-- $(document).ready(function() { $('ul.course-nav li a').each(function() { alert(5); if ('#' == $(this).attr('href')) { $(this).addClass('lessOpacity'); } }); }); //--> </script> HTML of course contains searched elements: <ul class="course-nav"> <li><a href="navigator.php?k...

How to evaluate jQuery on the server in c#

Following Rick Strahl's example we evaluate javascript on the server. Now I want to leverage jQuery. However we evaluating the jquery script this gives an error: 'Expected identifier or string' Any clue what this might be? Ultimately I want to render jQuery Templates on the server in the same way as they are rendered in the browser. ...

jQuery UI Draggable not dragging from the correct place.

When I grab my draggable(s), they seem to snap incorrectly to the grid on the right - this has me confused! Any idea how I can drag an element and have it snap closer to my cursor?? code: <html> <head> <title></title> <script type="text/javascript" language="javascript" src="sys/jquery-1.4.2.js"></script> <...

Check Checkbox based on value in CSV

If I have a csv of 23,56,78 and I have a whole bunch of checkboxes three of which have these values, is there an easy way to select them? I suspect the answer is I need to itterate through my list and use a selector but is there another way? ...

How to create dropdown list with "new value" option ?

I would like to create a dropdown list where the last option will be to enter a new value. How could I create this ? Is there any jQuery plugin that provides such thing ? ...

How can I write this in jQuery?

Hi, Guys, There is two links in my body part: but i want to give them jquery touch, as I am a beginner to jquery, not able to get it done can you help? click <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">here</a> on clicking abov...

jQuery: Easy way to quick select a whole optgroup in select box

I use a jQuery function similar to the one in this thread: http://stackoverflow.com/questions/1473897/easy-way-to-quick-select-a-whole-optgroup-in-select-box But, when I click an <option> now it selects the whole optgroup, as the optgroup encloses the option elements. I use the following snippet: $("optgroup").click(function(e) { ...

jQuery SVG copy path to another SVG

How can I copy a path or a group out of an SVG-document loaded to the DOM with http://keith-wood.name/svg.html into a new SVG? I want to show thumbnails of the different elements.. every element got its own id, I tried the add-method but nothing happens. Anyone got an idea? ...

progress bar for server elaboration php script?

Is there a way to make a progress bar (using ajax and jquery) for any script runnig in the server? I use a php script to elaborate some datas and I want to output a percent info to the client browser of the script progress. I tried to use session var but with poor results. ...

Simple Jquery Question

HI there ... im am trying to create a simple Jquery within Droppable. The page works and allows me to drop a video onto the selected droppable area (div class="roundedVideoDrop"), but I want to stop the user from being able to drop more than 1 video in each div, which has been created. My code for this is : $("div.roundedVideoDrop").dr...

Jquery problem with IE 8

Hello i have this code that works perfect in Firefox but in IE 8 doesn't work and doesn't give me any error ?! $(".shp_div").change(function () { var str = ""; $("select option:selected").each(function () { var countprod =parseInt($("#countprod").val()); var str2 = $(this).val(); str2_ar...

asp:RadioButtonList and jQuery to show hide a panel

I have an asp:RadioButtonList named rblDependants which renders as follows and a panel pnlDependants and I need to hide it when radio button selection is "No" and show it when its "Yes". I have tried a few snippets from the forums and none seem to work fine. Can anyone help me pls....! <table id="ctl00_ContentPlaceHolder1_ctl02_rblDep...

upload progress bar.

Hi, I use php,jquery . I have a form where in a user uploads multiple files . when he cliks on submit . everything must get uploaded. and a progress bar must show how much of each image is uploaded. how do i do the progress bar thing for each image ? ...

Round Corners in IE using ui-corner-all

I was trying to get rounded corners in IE7 using jQuery's "ui-corner-all" class. This is how my page looks like. <html> <head> <script language="javascript" type="text/javascript" src="jquery.js"></script> <script language="javascript" type="text/javascript"> $(document).ready(function() { $('#btnSearch').addClass("ui-corn...

jQuery JSON AJAX call retrieving more than expected

I am calling this JSON file: { "data" : [ { "type" : "file", "target" : "TheGreatest.doc", "workspace" : "Huddle Workspace One", "user" : "Chan Marshall" }, { "type" : "comment", "target" : "martes.mp3", "workspace" : "Huddle...

Accessing plugin options from "sub" function

Hi there! I'm trying to build a logo slider plugin after I read this tutorial: http://www.learningjquery.com/2007/10/a-plugin-development-pattern My problem is, that I need to access the options set when the plugin was initialized, and not just the defaults. Does it make sense? $.fn.oSlider = function(options) { ...

Jquery: Why will this if-else statement only follow the if, or the else, but wont follow both when they're different conditions that can be met..

Question: Why wont the If and the Else both work, when both conditions can be met at different times by scrolling below or above '.fakeheading'? Is the Else-statement overpowering the If-statement? JQUERY: $(window).scrollTop(function() { $('.grid_12').find(function () { var $header = $(this); if ($header.off...

Maintain horizontal and vertical ScrollPosition on Postback in ASP.NET

Hi Guys, The coding is in ASP.NET C#. I have a gridview, with say 1000 records and I am inline editing one of the rows. On Clicking Update, I would like my Grid to be on the exact x y position it was on before the postback happened. If you are thinking along the lines of using the Page directive, MaintainScrollPositionOnPostback="true...