Search Results

Search found 299 results on 12 pages for 'jqueryui'.

Page 11/12 | < Previous Page | 7 8 9 10 11 12  | Next Page >

  • Selecting a form which is in an iframe using jQuery

    - by Khnle
    I have a form inside an iframe which is inside a jQuery UI dialog box. The form contains a file input type. The jQuery UI dialog contains an Upload button. When this button is clicked, I would like to programmatically call the submit method. My question is how I could select the form which is in a iframe using jQuery. The following code should clarify the picture: <div id="upload_file_picker_dlg" title="Upload file"> <iframe id="upload_file_iframe" src="/frame_src_url" frameborder=0 width=100% scrolling=no></iframe> </div> frame_src_url contains: <form action="/UploadTaxTable" enctype="multipart/form-data" method="post" id="upload-form"> <p>Select a file to be uploaded:</p> <p> <input type="file" name="datafile" size="60"> </p> The jQueryUI dialog box javascript code: $('#upload_file_picker_dlg').dialog({ ... buttons: { 'Close': function() { $(this).dialog('close'); }, 'Upload': function() { $('#upload-form').submit(); //question is related to this line $(this).dialog('close'); } }, .... }); From the javascript code snippet above, how can I select the form with id upload-form that is in the iframe whose id is upload_file_iframe ?

    Read the article

  • Determining selected state of jQuery Buttons

    - by lloydphillips
    I've got two radio buttons in a .net page which are being transformed to jQuery buttons a la http://jqueryui.com/demos/button/#radio When the page is loaded I have button 2 as checked. When clicking the buttons I'm firing the postback event. Problem is you can click on that button that is selected by default on the initial load i.e. Button 2, the postback is fired but the event handler isn't called in the .net code behind because the radio button is already classed as selected (and in normal circumstances wouldn't allow the postback to fire). To get around this I've added the e.PreventDefault() method BUT this is causing issues when Button 1 is clicked because before the click handler is called the button is set to selected. Therefore, in every case in the following code e.PreventDefault() is called: $(document).ready(function(){ $("[id*='rbPayable']").click(function(e){ if ($("[id*='rbPayable']").attr("checked")) e.preventDefault(); else setTimeout('__doPostBack(\'this.id\',\'\')', 0) }) $("[id*='rbReceivable']").click(function(e){ if ($("[id*='rbReceivable']").attr("checked")) e.preventDefault(); else setTimeout('__doPostBack(\'this.id\',\'\')', 0) }) }); What is the best way for me to load the page and effectively be able to do the following: 'If rbReceivable is checked then don't do anything otherwise do a postback.'

    Read the article

  • jQuery selectable with a single element deselected by clicking

    - by BerggreenDK
    I would like to be able to deselect a selected item by clicking or using lasso, just like in Photoshop where I keep another key down to "deselect" parts of an existing selection. Is this possible? As I understand "jQuery UI selectable". There is only "single click" with or without CTRL to add multiple and then the quick lasso. I am trying to see how it would be possible to deselect, one or two elements of a whole selection by clicking them off again. Eg, you drag the lasso and get 30 elements but finds that 1 does not need to be part of this selection. You click it and deselects it. So something that reacts to the existing selection and removes the choosen element. Or with the lasso, you make a lasso selection. Gets 30 elements. Then you draw a new lasso, this time starting on an already selected element, now it default deselects and so does the rest of the group marked. I believe this should be customizable behaviour for the jQueryUI if anything. But is the "single deselect" possible with a simple jQuery hack or will it demand a lot of code?

    Read the article

  • IE8 ignores jQuery UI 'dialog' minHeight and height settings

    - by Kev
    I'm using jQuery 1.4.4 with jQueryUI 1.8.7 to display a modal dialog box. I'm having a problem where IE8 renders a scrollbar and appears to ignore the minHeight and height options in all the many different combinations I've tried them in. In Chrome 8 and Firefox 3.6 my dialogue looks like: In IE 8 it looks like: The markup and script looks like: <a id="create" href="#">Create New Thing</a> <div id="dlg-create-thing" title="Create new thing?"> <form name="create-thing-form" id="dlg-create-thing-form"> <p style="text-align:left"> <span>Name: <input id="thingName" name="thingName" maxlength="12" size="30" /></span> <br /><br /> <b>Thing options:</b><br /><br /> <input type="radio" id="option1" name="theoptions" value="0" checked="checked" />Use this option<br /> <input type="radio" id="option1AndMem" name="theoptions" value="1" />Use this other option </p> </form> </div> <script type="text/javascript"> $(function () { $("#dlg-create-thing").dialog({ autoOpen: false, resizable: false, width: 500, modal: true, minHeight: 280, buttons: { "Create": function () { /* do stuff */ }, "Cancel": function () { /* do other stuff */} } }); $("body").delegate("a[id='create']", "click", function () { $("#dlg-create-thing").dialog('open'); return false; } ); }); </script> How can I fix this (preferably in a nice browser agnostic way, but I'd settle for anything)?

    Read the article

  • When is 'focus' called in 'autocomplete'

    - by user470184
    The 'focus' documentation from http://jqueryui.com/demos/autocomplete/ states : focusType:autocompletefocus Before focus is moved to an item (not selecting), ui.item refers to the focused item. The default action of focus is to replace the text field's value with the value of the focused item, though only if the focus event was triggered by a keyboard interaction. Canceling this event prevents the value from being updated, but does not prevent the menu item from being focused. Code examples Supply a callback function to handle the focus event as an init option. $( ".selector" ).autocomplete({ focus: function(event, ui) { ... } }); Bind to the focus event by type: autocompletefocus. $( ".selector" ).bind( "autocompletefocus", function(event, ui) { ... }); Using below code sets an attribute called 'mytag' with value 'tester' on all of the autocomplete elements even though I have not selected the elements. Why is the attribute 'focus' not added just when one of the drop downs is focused, instead of being added when page is loaded ? $("#myDiv").autocomplete({ source: availableTags, focus: function(event, ui) { $(".ui-autocomplete li").attr("mytag", "tester"); } });

    Read the article

  • jQuery Validation Plugin ErrorPlacement inside two different elements

    - by Andy Poquette
    I'm trying to place separate error messages in separate elements when validating a large form. The form is divided into jQueryUI tabs, then accordions. When there is an error in an element of a tab, I want to append a red exclamation point to the name of the tab, and if the error is in an accordion element, I also want to append the red exclamation point to the name of the accordion element. Subsequently, when the errors are corrected, I would like those red ! to be removed (exactly as the error message beneath the invalid field is removed. So: Tab1 Tab2 Accordion1 Accordion2 Tab3 If the elements in accordion 2 have an error, I want to append a red ! to accordion2 and tab2: Tab1 Tab2! Accordion1 Accordion2! Tab3 Then remove when the elements successfully validate. I've been trying forever, but I can't figure out how to conditionally change the errorElement (a label won't work for the tab and accordion, but is perfect for the actual element)... Hopefully this makes sense, and thanks for any input you can provide.

    Read the article

  • Run script after Jquery finish

    - by Felipe Fernández
    First let's explain the hack that I was trying to implement. When using Total Validator Tool through my web page and I get following error: [WCAG v1 6.3 (A), US-508-l] Consider providing a alternative after each tag As my page relies heavily on javascript I can't provide a real alternative, so I decided to add an empty noscript tag after every script appearence. Let's say I need to provide a clean report about accesibility about my web page even the hack is senseless. (I know the hack is unethical and silly, let's use it as example material, but the point of my post are the final questions) I tried the following approach: $(document).ready(function(){ $("script").each(function() { $(this).after("<noscript></noscript>"); }); }); The problem raises because I have a jQueryUI DatePicker component on my page. jQuery adds a script section after the DOM is ready so my hack fails as miss this section. So the questions are: How handles jQuery library to be executed after document is ready? How can I run my code after jQuery finish its labours?

    Read the article

  • class selector refuses after append to body

    - by supersize
    I'm appending loads of divs in a wrapper: var cubes = [], allCubes = '', for(var i = 0; i < 380; i++) { var randomleft = Math.floor(Math.random()*Math.floor(Math.random()*1000)), randomtop = Math.floor(Math.random()*Math.floor(Math.random()*1000)); allCubes += '<div id="cube'+i+'" class="cube" style="position: absolute; border: 2px #000 solid; left: '+randomleft+'px; top: '+randomtop+'px; width: 9px; height: 9px; z-index: -1"></div>'; } $('#wrapper').append(allCubes); // performance for(var i = 0; i < 380; i++) { cubes.push($('#cube'+i)); } and then I would like to make them all draggable with jQueryUI and log their current position. var allc = $('.cube'); allc.draggable().on('mouseup', function(i) { allc.each(function() { var nleft = $(this).offset().left; var ntop = $(this).offset().top; console.log('cubes['+i+'].animate({ left:'+nleft+',top:'+ntop+'})'); }); }); Unfortunenately it does not work. They are neither draggable nor there comes up a log. Thanks

    Read the article

  • help with css formatting on table and div

    - by kralco626
    I have the following html (i'm also using Jquery and JqueryUI) <div style="display:none; position:fixed; z-index:100;padding:0;margin:0" class="ui-state-highlight" id="Info"> <table cellpadding="0" cellspacing="0" style="padding:0;margin:0"> <tr style="padding:0;margin:0;"> <td><span class="ui-icon ui-icon-info"></span></td> <td width = "100%" style="padding:0;margin:0;"><div id = "InfoText"></div></td> <td><button style="width:25px;height:25px;margin:0;padding:0" id="closeInfo"></button></td> </tr> </table> </div> It procudes the following: See where i circled in red? I want to get rid of that yellow space under the button, but i can't figure out how... Thanks!

    Read the article

  • getting (this) at different function

    - by twen_ta
    I have couple of input fields with the class "link". All of them should start the jqueryUI dialog so this is why I bind the method to a class and not an single id. The difficulty is now that i can't use the (this) in line 12, because that gives me the identity of the dialog and not the input element. As I am an beginner I don't know how to pass a variable to this event with the element of the input field. What I want to archive is that the dialog should start from the input field and should write the result back to that input field. 1. // this is the click event for the input-field class called "link" 2. $('.link') 3. .button() 4. .click(function() { 5. $('#dialog-form').dialog('open'); 6. 7. }); 8. 9. //this is an excerpt from the opened dialog box and the write back to the input field 10. $("#dialog-form").dialog({ 11. if (bValid) { 12. $('.link').val('' + 14. name.val() + ''); 15. $(this).dialog('close'); 16. } 17. });

    Read the article

  • jquery-ui drag and drop - how to dropped items?

    - by user246114
    Hi, I'm trying to use jquery-ui. I am using one of the drag and drop examples which is pretty much exactly what I need, except instead of moving items between the two lists, I'd like the items to be cloned: http://jqueryui.com/demos/sortable/#connect-lists $(function() { $("#sortable1, #sortable2").sortable({ connectWith: '.connectedSortable' }).disableSelection(); }); <ul id="sortable1" class="connectedSortable"> <li class="ui-state-default">Item 1</li> <li class="ui-state-default">Item 2</li> <li class="ui-state-default">Item 3</li> </ul> <ul id="sortable2" class="connectedSortable"> <li class="ui-state-default">Item 1</li> <li class="ui-state-default">Item 2</li> <li class="ui-state-default">Item 3</li> </ul> so moving an item from the first list to the second list results in list 1 have 2 items, and list 2 having 4 items. I just want it to make clones of the items on the drop. So in the above example, list 1 would still have 3 items, but list 2 would have 4 items, Thank you

    Read the article

  • Jquery-UI tabs : Double loading of the default tab

    - by Stephane
    I use jqueryui-tabs to display a tabbed UI. here is how my markup looks in a MasterPage: <div id="channel-tabs" class="ui-tabs"> <ul class="ui-tabs-nav"> <li><%=Html.ActionLink("Blogs", "Index", "Blog", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, new{ title="Blog Results" }) %></li> <li><%=Html.ActionLink("Forums", "Index", "Forums", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, null) %></li> <li><%=Html.ActionLink("Twitter", "Index", "Twitter", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, null) %></li> </ul> <div id="Blog_Results"> <asp:ContentPlaceHolder ID="ResultPlaceHolder" runat="server"> </asp:ContentPlaceHolder> </div> If the content is loaded via ajax, I return a partial view with the content of the tab. If the content is loaded directly, I load a page that include the content in the ContentPlaceHolder. somewhat like this : <asp:Content ID="Content2" ContentPlaceHolderID="BlogPlaceHolder" runat="server"> <%=Html.Partial("Partial",Model) %> </asp:Content> //same goes for the other tabs. With this in place, if I access the url "/Forums" It loads the forum content in the Blog tab first, trigger the ajax load of the Blog tab and replace the content with the blog content. I tried putting a different placeholder for each tab, but that didn't fix everything either, since when loading "/Forums" it will sure load the forum tab, but the Blog tab will show up first. Furthermore, when using separate placeholders, If I load the "/Blogs" url, It will first load the content statically in the Blog contentplaceholder and then trigger an ajax call to load it a second time and replace it. If I just link the tab to the hashtag, then when loading the forum tabs, I won't get the blog content... How would you achieve the expected behaviour? I feel like I might have a deeper probelm in the organization of my views. Is putting the tabs in the masterpage the way to go? Maybe I should just hijax the links manually and not rely on jquery-ui tabs to do the work for me. I cannot load all tabs by default and display them using the hash tags, I need an ajax loading because it is a search process that can be long. So to sum up : /Forum should load the forum tab, and let the other tabs be loaded with an ajax call when clicking on it. /Twitter should load the twitter tab and let the other tabs.... the same goes for /Blogs and any tabs I would add later. Any idea to have this working properly?

    Read the article

  • jQueryMobile: how to work with slider events?

    - by balexandre
    I'm testing the slider events in jQueryMobile and I must been missing something. page code is: <div data-role="fieldcontain"> <label for="slider">Input slider:</label> <input type="range" name="slider" id="slider" value="0" min="0" max="100" /> </div> and if I do: $("#slider").data("events"); I get blur, focus, keyup, remove What I want to do is to get the value once user release the slider handle and having a hook to the keyup event as $("#slider").bind("keyup", function() { alert('here'); } ); does absolutely nothing :( I must say that I wrongly assumed that jQueryMobile used jQueryUI controls as it was my first thought, but now working deep in the events I can see this is not the case, only in terms of CSS Design. What can I do? jQuery Mobile Slider source code can be found on Git if it helps anyone as well a test page can be found at JSBin As I understand, the #slider is the textbox with the value, so I would need to hook into the slider handle as the generated code for this slider is: <div data-role="fieldcontain" class="ui-field-contain ui-body ui-br"> <label for="slider" class="ui-input-text ui-slider" id="slider-label">Input slider:</label> <input data-type="range" max="100" min="0" value="0" id="slider" name="slider" class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c ui-slider-input" /> <div role="application" class="ui-slider ui-btn-down-c ui-btn-corner-all"> <a class="ui-slider-handle ui-btn ui-btn-corner-all ui-shadow ui-btn-up-c" href="#" data-theme="c" role="slider" aria-valuemin="0" aria-valuemax="100" aria-valuenow="54" aria-valuetext="54" title="54" aria-labelledby="slider-label" style="left: 54%;"> <span class="ui-btn-inner ui-btn-corner-all"> <span class="ui-btn-text"></span> </span> </a> </div> </div> and checking the events in the handler anchor I get only the click event $("#slider").next().find("a").data("events");

    Read the article

  • Node.js + Express.js. How to RENDER less css?

    - by Paden
    Hello all, I am unable to render less css in my express workspace. Here is my current configuration (my css/less files go in 'public/stylo/'): app.configure(function() { app.set('views' , __dirname + '/views' ); app.set('partials' , __dirname + '/views/partials'); app.set('view engine', 'jade' ); app.use(express.bodyDecoder() ); app.use(express.methodOverride()); app.use(express.compiler({ src: __dirname + '/public/stylo', enable: ['less']})); app.use(app.router); app.use(express.staticProvider(__dirname + '/public')); }); Here is my main.jade file: !!! html(lang="en") head title Yea a title link(rel="stylesheet", type="text/css", href="/stylo/main.less") link(rel="stylesheet", href="http://fonts.googleapis.com/cssfamily=Droid+Sans|Droid+Sans+Mono|Ubuntu|Droid+Serif") script(src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js") script(src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js") body!= body here is my main.less css: @import "goodies.css"; body { .googleFont; background-color : #000000; padding : 20px; margin : 0px; > .header { border-bottom : 1px solid #BBB; background-color : #f0f0f0; margin : -25px -25px 30px -25px; /* important */ color : #333; padding : 15px; font-size : 18pt; } } AND here is my goodies.less css: .rounded_corners(@radius: 10px) { -moz-border-radius : @radius; -webkit-border-radius: @radius; border-radius : @radius; } .shadows(@rad1: 0px, @rad2: 1px, @rad3: 3px, @color: #999) { -webkit-box-shadow : @rad1 @rad2 @rad3 @color; -moz-box-shadow : @rad1 @rad2 @rad3 @color; box-shadow : @rad1 @rad2 @rad3 @color; } .gradient (@type: linear, @pos1: left top, @pos2: left bottom, @color1: #f5f5f5, @color2: #ececec) { background-image : -webkit-gradient(@type, @pos1, @pos2, from(@color1), to(@color2)); background-image : -moz-linear-gradient(@color1, @color2); } .googleFont { font-family : 'Droid Serif'; } Cool deal. Now: I have installed less via npm and I had heard from another post that @imports should reference the .css not the .less. In any case, I have tried the combinations of switching .less for .css in the jade and less files with no success. If you can help or have the solution I'd greatly appreciate it. Note: The jade portion works fine if I enter any ol' .css. Note2: The less compiles if I use lessc via command line.

    Read the article

  • load google annotated chart within jquery ui tab content via ajax method

    - by twmulloy
    Hi, I am encountering an issue with trying to load a google annotated chart (http://code.google.com/apis/visualization/documentation/gallery/annotatedtimeline.html) within a jquery ui tab using content via ajax method (http://jqueryui.com/demos/tabs/#ajax). If instead I use the default tabs functionality, writing out the code things work fine: <div id="tabs"> <ul> <li><a href="#tabs-1">Chart</a></li> </ul> <div id="tabs-1"> <script type="text/javascript"> google.load('visualization', '1', {'packages':['annotatedtimeline']}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('date', 'Date'); data.addColumn('number', 'cloudofinc.com'); data.addColumn('string', 'header'); data.addColumn('string', 'text') data.addColumn('number', 'All Clients'); data.addRows([ [new Date('May 12, 2010'), 2, '2 New Users', '', 3], [new Date('May 13, 2010'), 0, undefined, undefined, 0], [new Date('May 14, 2010'), 0, undefined, undefined, 0], ]); var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_users')); chart.draw(data, { displayAnnotations: false, fill: 10, thickness: 1 }); } </script> <div id='chart_users' style='width: 100%; height: 400px;'></div> </div> </div> But if I use the ajax method for jquery ui tab and point to the partial for the tab, it doesn't work completely. The page renders and once the chart loads, the browser window goes white. However, you can see the tab partial flash just before the chart appears to finish rendering (the chart never actually displays). I have verified that the partial is indeed loading properly without the chart. <div id="tabs"> <ul> <li><a href="ajax/tabs-1">Chart</a></li> </ul> </div>

    Read the article

  • JQGrid and JQuery Autocomplete

    - by Neff
    When implementing JQGrid 4.3.0, Jquery 1.6.2, and JQuery UI 1.8.16 Ive come across an issue with the Inline edit. When the inline edit is activated, some of the elements get assigned an auto complete. When the inline edit is canceld or saved, the auto complete does not always go away (selecting text by double clicking it then hitting delete, then hitting escape to exit row edit). Leaving the auto complete controls in edit mode when the row is no longer considered in edit mode. Perhaps you can tell me if there is a problem with the initialization or if I you are aware of an event post-"afterrestorefunc" that the fields can be returned to their "original" state. Original state being displayed as data in the JQGrid row. I've tried removing the DOM after row close, .remove() and .empty(): ... "afterrestorefunc": function(){ $('.ui-autocomplete-input').remove(); } ... but that causes other issues, such as the jqgrid is not able to find the cell when serializing the row for data or edit, and requires a refresh of the page, not just jqgrid, to be able to once again see the data from that row. Auto complete functionality for the element is created on the double click of the row: function CreateCustomSearchElement(value, options, selectiontype) { ... var el; el = document.createElement("input"); ... $(el).autocomplete({ source: function (request, response) { $.ajax({ url: '<%=ResolveUrl("~/Services/AutoCompleteService.asmx/GetAutoCompleteResponse") %>', data: "{ 'prefixText': '" + request.term + "', 'contextKey': '" + options.name + "'}", dataType: "json", type: "POST", contentType: "application/json; charset=utf-8", success: function (data) { response($.map(data.d, function (item) { return { label: Trim(item), value: Trim(item), searchVal: Trim(item) } })) } }); }, select: function (e, item) { //Select is on the event of selection where the value and label have already been determined. }, minLength: 1, change: function (event, ui) { //if the active element was not the search button //... } }).keyup(function (e) { if (e.keyCode == 8 || e.keyCode == 46) { //If the user hits backspace or delete, check the value of the textbox before setting the searchValue //... } }).keydown(function (e) { //if keycode is enter key and there is a value, you need to validate the data through select or change(onblur) if (e.keyCode == '13' && ($(el).val())) { return false; } if (e.keyCode == '220') { return false } }); } Other Sources: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing http://api.jqueryui.com/autocomplete/ Update: I tried only creating the autocomplete when the element was focused, and removing it when onblur. That did not resolve the issue either. It seems to just need the autocomplete dropdown to be triggered.

    Read the article

  • JQuery autocomplete: is not working asp.net

    - by Abu Hamzah
    is that something wrong in the below code? its not firing at all edit <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HostPage.aspx.cs" Inherits="HostPage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <link rel="stylesheet" href="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.css" type="text/css" /> <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js"></script> </head> <body> <form id="form1" runat="server"> <script type="text/javascript"> $(document).ready(function() { $("#<%=txtHost.UniqueID %>").autocomplete("HostService.asmx/GetHosts", { dataType: 'json' , contentType: "application/json; charset=utf-8" , parse: function(data) { var rows = Array(); debugger for (var i = 0; i < data.length; i++) { rows[i] = { data: data[i], value: data[i].LName, result: data[i].LName }; } return rows; } , formatItem: function(row, i, max) { return data.LName + ", " + data.FName; } }); }); </script> <div> <asp:Label runat="server" ID='Label4' >Host Name:</asp:Label> <asp:TextBox ID="txtHost" runat='server'></asp:TextBox> <p> </div> </form> </body> </html>

    Read the article

  • jQuery - draggable images on iPad / iPhone - how to integrate event.preventDefault();?

    - by Tim
    Hello! I use jQuery, jQuery UI and jQuery mobile to build a web application for iPhone / iPad. Now I create images and they should be draggable, so I did this: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>Drag - Test</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" /> <script src="http://code.jquery.com/jquery-1.4.4.min.js"></script> <script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"></script> </head> <body> <div> <div style="width:500px;height:500px;border:1px solid red;"> <img src="http://upload.wikimedia.org/wikipedia/en/thumb/9/9e/JQuery_logo.svg/200px-JQuery_logo.svg.png" class="draggable" alt="jQuery logo" /> <img src="http://upload.wikimedia.org/wikipedia/en/a/ab/Apple-logo.png" class="draggable" alt="Apple Inc. logo" /> </div> </div> </body> <script type="text/javascript"> $(document).ready(function() { $(".draggable").draggable(); }); </script> </html> Here you can see the live example: http://jsbin.com/igena4/ The problem is, that the whole page want to scroll. I searched in Apple's HTML5 examples and found this to prevent the scrolling of the page, so that the image is draggable: ... onDragStart: function(event) { // stop page from panning on iPhone/iPad - we're moving a note, not the page event.preventDefault(); ... } But the problem is for me, how can I include this into my jQuery? Where do I get event? Best Regards.

    Read the article

  • Rails 3.1 text_field form helper and jQuery datepicker date format

    - by DanyW
    I have a form field in my Rails view like this: <%= f.text_field :date, :class => "datepicker" %> A javascript function converts all input fields of that class to a jQueryUI datepicker. $(".datepicker").datepicker({ dateFormat : "dd MM yy", buttonImageOnly : true, buttonImage : "<%= asset_path('iconDatePicker.gif') %>", showOn : "both", changeMonth : true, changeYear : true, yearRange : "c-20:c+5" }) So far so good. I can edit the record and it persists the date correctly all the way to the DB. My problem is when I want to edit the record again. When the form is pre-populated from the record it displays in 'yyyy-mm-dd' format. The javascript only formats dates which are selected in the datepicker control. Is there any way I can format the date retrieved from the database? At which stage can I do this? Thanks, Dany. Some more details following the discussion below, my form is spread across two files, a view and a partial. Here's the view: <%= form_tag("/shows/update_individual", :method => "put") do %> <% for show in @shows %> <%= fields_for "shows[]", show do |f| %> <%= render "fields", :f => f %> <% end %> <% end %> <%= submit_tag "Submit"%> <% end %> And here's the _fields partial view: <p> <%= f.label :name %> <%= f.text_field :name %> </p> <p> <%= f.date %> <%= f.label :date %> <%= f.text_field :date, :class => "datepicker" %> </p> Controller code: def edit_individual @shows = Show.find(params[:show_ids]) end

    Read the article

  • Very simple jquery ui drag and drop does not work. Why not?

    - by Catfish
    WHy doesn't this work? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> #content { background:#CCCCCC; width:500px; height:500px; } #drop { height:200px; width:200px; background:#00FFFF; float:right; } #drag { background:#009966; width:100px; height:100px; float:left; } .active { background:#FFCC33; } </style> <script type="text/ecmascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#drag').draggable({ containment: '#content', scrollSensitivity: 60, revert: true, cursor: 'move' }); $('#drop').droppable({ accept: '#drag', drop: function(event, ui) { $(this).addClass('.active'); } }); }); </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <div id="content"> <div id="drag"> </div> <div id="drop"> </div> </div> </body> </html>

    Read the article

  • JQuery in ASP.NET - Form Validation Issue

    - by user1026288
    It's not working at all and I'm not sure why. Ideally I'd like to have all the errors pop up in a modal dialog box. But right now I can't even get it to work normally. Any help would be appreciated. Thanks. HTML <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js" type="text/javascript"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script> <script src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js" type="text/javascript"></script> <script src="../Scripts/Frame.js" type="text/javascript"></script> </head> <body runat="server" id="bodyLogin"> <div runat="server" id="frameLogin"> <form runat="server" id="formLogin"> <asp:CheckBox runat="server" ID="checkboxRemember" /> <div><span id="un">Username</span><div id="forgotUsername">?</div><br /> <asp:TextBox runat="server" ID="textUsername" Name="username" /></div> <div><span id="pw">Password</span><div id="forgotPassword">?</div><br /> <asp:TextBox runat="server" ID="textPassword" Name="password" TextMode="Password" /></div> <asp:Button runat="server" ID="buttonLogin" Text="L" /> <asp:Button runat="server" ID="buttonRegister" Text="R" /> </form> </div> <div id="dialog" title="Errors" style="display:none;"><ul></ul></div> </body> </html> JQuery <script type="text/javascript"> $(function () { $("#formLogin").validate({ rules: { username: { required:true, minlength:3, maxlength:15 }, password: { required:true, minlength:6, maxlength:15 }, }, messages: { username: { required: "Username is required.", minlength: "Username minimum length is 3 characters.", maxlength: "Username maxumum length is 15 characters." }, password: { required: "Password is required.", minlength: "Password minumum length is 6 characters.", maxlength: "Password maximum length is 15 characters." } } }); }); </script>

    Read the article

  • Jquery-UI tabs : Double loading of the default tab with

    - by Stephane
    I use jqueryui-tabs to display a tabbed UI. here is how my markup looks in a MasterPage: <div id="channel-tabs" class="ui-tabs"> <ul class="ui-tabs-nav"> <li><%=Html.ActionLink("Blogs", "Index", "Blog", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, new{ title="Blog Results" }) %></li> <li><%=Html.ActionLink("Forums", "Index", "Forums", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, null) %></li> <li><%=Html.ActionLink("Twitter", "Index", "Twitter", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, null) %></li> </ul> <div id="Blog_Results"> <asp:ContentPlaceHolder ID="ResultPlaceHolder" runat="server"> </asp:ContentPlaceHolder> </div> If the content is loaded via ajax, I return a partial view with the content of the tab. If the content is loaded directly, I load a page that include the content in the ContentPlaceHolder. somewhat like this : <asp:Content ID="Content2" ContentPlaceHolderID="BlogPlaceHolder" runat="server"> <%=Html.Partial("Partial",Model) %> </asp:Content> //same goes for the other tabs. With this in place, if I access the url "/Forums" It loads the forum content in the Blog tab first, trigger the ajax load of the Blog tab and replace the content with the blog content. I tried putting a different placeholder for each tab, but that didn't fix everything either, since when loading "/Forums" it will sure load the forum tab, but the Blog tab will show up first. Furthermore, when using separate placeholders, If I load the "/Blogs" url, It will first load the content statically in the Blog contentplaceholder and then trigger an ajax call to load it a second time and replace it. If I just link the tab to the hashtag, then when loading the forum tabs, I won't get the blog content... How would you achieve the expected behaviour? I feel like I might have a deeper probelm in the organization of my views. Is putting the tabs in the masterpage the way to go? Maybe I should just hijax the links manually and not rely on jquery-ui tabs to do the work for me. I cannot load all tabs by default and display them using the hash tags, I need an ajax loading because it is a search process that can be long. So to sum up : /Forum should load the forum tab, and let the other tabs be loaded with an ajax call when clicking on it. /Twitter should load the twitter tab and let the other tabs.... the same goes for /Blogs and any tabs I would add later.

    Read the article

  • RaphaelJS HTML5 Library pathIntersection() bug or alternative optimisation (screenshots)

    - by user1236048
    I have a chart generated using RaphaelJS library. It is just on long path: M 50 122 L 63.230769230769226 130 L 76.46153846153845 130 L 89.6923076923077 128 L 102.92307692307692 56 L 116.15384615384615 106 L 129.3846153846154 88 L 142.6153846153846 114 L 155.84615384615384 52 L 169.07692307692307 30 L 182.3076923076923 62 L 195.53846153846152 130 L 208.76923076923077 74 L 222 130 L 235.23076923076923 66 L 248.46153846153845 102 L 261.6923076923077 32 L 274.9230769230769 130 L 288.15384615384613 130 L 301.38461538461536 32 L 314.6153846153846 86 L 327.8461538461538 130 L 341.07692307692304 70 L 354.30769230769226 130 L 367.53846153846155 102 L 380.7692307692308 120 L 394 112 L 407.2307692307692 68 L 420.46153846153845 48 L 433.6923076923077 92 L 446.9230769230769 128 L 460.15384615384613 110 L 473.38461538461536 78 L 486.6153846153846 130 L 499.8461538461538 56 L 513.0769230769231 116 L 526.3076923076923 80 L 539.5384615384614 58 L 552.7692307692307 40 L 566 130 L 579.2307692307692 94 L 592.4615384615385 64 L 605.6923076923076 122 L 618.9230769230769 98 L 632.1538461538461 120 L 645.3846153846154 70 L 658.6153846153845 82 L 671.8461538461538 76 L 685.0769230769231 124 L 698.3076923076923 110 L 711.5384615384615 94 L 724.7692307692307 130 L 738 130 L 751.2307692307692 66 L 764.4615384615385 118 L 777.6923076923076 70 L 790.9230769230769 130 L 804.1538461538461 44 L 817.3846153846154 130 L 830.6153846153845 36 L 843.8461538461538 92 L 857.076923076923 130 L 870.3076923076923 76 L 883.5384615384614 130 L 896.7692307692307 60 L 910 88 Also below these chart I have a jqueryUI slider of the same width (860px) and centered with the chart. I want when I move the slider to move a dot on the chart accordingly with the slider position. See attached screenshot: As you can see it seems to work fine. I've implemented this behaviour using the pathIntersection() method. On the slide event at each ui.value (x coordinate) I intersect my chartPath (the one from above) with a vertical straight line at the x coordinate. But still there are some problems. One of them is that it runs very hard, and it kinda freezes sometimes.. and very weird sometimes it doesn't seem to intersect at all even it should.. I'll example below 2 cases I identified: M 499.8461538461538 0 L 499.8461538461538 140 M 910 0 L 910 140 Could you please explain why this intersect behaviour happens (it should return a dot).. and the worst part it seems like it happens randomly.. if I use another chartdata. Also if you can identify another (better) solution to syncronise the slider position with the dot on the chart.. would be perfect. I thought about using Element.getPointAtLength(length), but I don't know how. I think I should save the pathSegments and for each to compute the start Length and the finish Length.

    Read the article

  • How to close a jquery dialog box when a submit button is clicked(Submit button is residing inside the dialog box)

    - by user1268313
    i have struts2 form inside a jquery dialog box, when i submit my form inside that dialog box my Struts2 action is performing but that pop up jquery dialog box is not closing. How can i close that dialog box when![enter image description here][1] i submit my form? <table> <tr> <td> <td align="center" > <sj:head jqueryui="true" jquerytheme="cupertino" /> <sj:dialog id="mybuttondialog" autoOpen="false" showEffect="fadeIn" hideEffect="fadeOut" modal="true" title="Rename" > <s:form action="EditDayActionUserTemplate" id="formId323"> <table style="height:48px;width: 100%;" cellpadding="0" cellspacing="0" border="0"> <tr> <td colspan="2" align="center"> <input type="hidden" name="dayId" value="<%=daycont%>"/> <input type="hidden" name="workoutId" value="<%=trid%>"/> </td> </tr> <tr> <td width="50%" align="right"><font size="6px">Date</font></td> <td width="50%"> <sj:datepicker id="datghfe4" name="date" value="%{#parameters['date']}" label="Select Date" appendText=" (dd.MM.yy)" displayFormat="dd.M.yy"/></td> </tr> <tr> <td>&nbsp;</td> <td align="right"><sj:submit formIds="formId323" id="sdfdss3" button="true" value="Rename" targets="rightmiddiv"></sj:submit></td> </tr> </table> </s:form> </sj:dialog> <sj:submit openDialog="mybuttondialog" value="Rename" button="true" /> </td> </tr> </table>

    Read the article

  • Unable to fetch Json data from remote url

    - by user3772611
    I am cracking my head to solve this thing. I am unable to fetch the JSON data from remote REST API. I need to fetch the JSOn data nd display the "html_url" field from the JSON data on my website. I saw that you need the below charset and content type for fetching JSON. <html> <head> <meta charset="utf-8"> <meta http-equiv="content-type" content="application/json"> </head> <body> <p>My Instruments page</p> <ul></ul> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script type="text/javascript"> $(document).ready(function () { alert("Inside the script"); $.getJSON(" https://pki.zendesk.com/api/v2/help_center/sections/200268985/articles.json", function (obj) { alert("Inside the getJSON"); $.each(obj, function (key, value) { $("ul").append("<li>" + value.html_url + "</li>"); }); }); }); </script> </body> </html> I referred to following example on jsfiddle http://jsfiddle.net/2xTjf/29/ The "http://date.jsontest.com" given in this example also doesn't work in my code. The first alert is pops but not the other one. I am a novice at JSON/ Jquery. i used jsonlint.com to find if it has valid JSON, it came out valid. I tested using chrome REST client too. What am I missing here ? Help me please ! Thanks in anticipation.

    Read the article

< Previous Page | 7 8 9 10 11 12  | Next Page >