Search Results

Search found 23364 results on 935 pages for 'jquery ui droppable'.

Page 76/935 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • Javascript UI Toolkit

    - by Louis
    I'm looking for a light-weight UI toolkit written in Javascript (something like Swing) but I'd rather not use ExtJS because I fear that will slow things down tremendously. Are there any small UI toolkits out there that mainly focus on layouts?

    Read the article

  • JSF Data transfer between UI to Business Layers

    - by Ram
    Hi, We are using JSF in UI,Spring in Business Layer,Hibernate in Persistance layer.Now my question is how to pass data from my JSF1.1_01 UI to spring Business Layer.Can I directly used my Business object in my Backed Bean or through DTO should I transfer data between the layer? Can one explain me with clear explanation if possible with piece of code and that related websites?

    Read the article

  • How to continuously scroll content within a DIV using jQuery?

    - by Camsoft
    Aim The aim is to a have a container DIV with a fixed height and width and have the HTML content within that DIV automatically scroll vertically continuously. Question Basically I've created the code below using jQuery to scroll (move) the child DIV vertically upwards until its outside the bounding parent box where the animation then completes which triggers an event handler which resets the position of the child DIV and starts the process again. This works fine, so the content scrolls up leaving a blank space and then starts from the bottom again and scrolls up. The problem I have is that the requirements for this is for the content to appear as if it was continuously repeating, see below diagram to better explain this, is there a way to do this? (I don't want to use 3rd party plug ins or libraries other than jQuery): What I have so far The HTML: <div id="scrollingContainer"> <div class="scroller"> <h1>This is a title</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at orci mi, id gravida tellus. Integer malesuada ante sit amet enim pulvinar congue. Donec pulvinar dolor et arcu posuere feugiat id et felis.</p> <p>More content....</p> </div> </div> The CSS: #scrollingContainer{ height: 300px; width: 300px; overflow: hidden; } #scrollingContainer DIV.scroller{ position: relative; } The JavaScript: /** * Scrolls the content DIV */ function scroll() { if($('DIV.scroller').height() > $('#scrollingContainer').height()) { var t = $('DIV.scroller').position().top + $('DIV.scroller').height(); /* Animate */ $('DIV.scroller').animate( { top: '-=' + t + 'px' } , 4000, 'linear', animationComplete); } } function animationComplete() { $(this).css('top', $('#scrollingContainer').height()); scroll(); }

    Read the article

  • jQuery Datatables throws error when dynamically created row headers

    - by JM4
    I am using the Datatables jquery plugin for one of my projects. For one in particular, the number of columns can vary based on how many children a consumer has (yes I realize normalization and proper technique would insert on another row but it is a client requirement). Datatables must be set up as such: <table> <thead> <tr> <th></th> </tr> </thead> <tbody> <tr> <td></td> </tr> </tbody> </table> my script starts out as: <table cellpadding="0" cellspacing="0" border="0" class="display" id="sortable"> <thead> <tr> <th>parent name</th> <th>parent phone</th> <?php try { $db->beginTransaction(); $stmt = $db->prepare("SELECT max(num_deps) FROM (SELECT count(a.id) as num_deps FROM children a INNER JOIN parents b USING(id) WHERE a.id !=0 GROUP BY a.id) x"); $stmt->execute(); $rows = $stmt->fetchAll(); for($i=1; $i<=$rows[0][0]; $i++) { echo " <th>Child Name ".$i."</th> <th>Date of Birth ".$i."</th> "; } $db->commit(); } catch (PDOException $e) { echo "<p align='center'>There was a system error. Please contact administration.<br>".$e->getMessage()."</p><br />"; } ?> </tr> </thead> In this manner, the final column headers can be 1 or 50 spots long. However, with this dynamic code in place, datatables throws the following error: ""DataTables warning (table id = 'datatable'): Cannot reinitialise DataTable. To retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrive to true. Alternativly, to destroy old table and create a new one...ETC."' Yes I have set "bRetrieve" : true in the javascript above and that does not do the trick. If I remove the code above, the file "works" fine but it leaves off the necessary columns for my table. Any ideas? Displaying JS <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script> <script type="text/javascript" src="../media/js/jquery.dataTables.min.js"></script> <script type="text/javascript" src="../media/js/TableTools/TableTools.js"></script> <script type="text/javascript" src="../media/ZeroClipboard/ZeroClipboard.js"></script> <script type="text/javascript"> $(document).ready(function() { TableToolsInit.sSwfPath = "../media/swf/ZeroClipboard.swf"; oTable = $('#sortable').dataTable({ "bRetrieve": true, "bProcessing": true, "sScrollX": "100%", "sScrollXInner": "110%", "bScrollCollapse": true, "bJQueryUI": true, "sPaginationType": "full_numbers", "sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>' }); }); </script> </head> TOP piece of HTML <!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> <title>Home</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="default.css" /> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <style type="text/css" title="currentStyle"> @import "TableTools.css"; @import "demo_table_jui.css"; @import "jquery-ui-1.8.4.custom.css"; </style> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script> <script type="text/javascript" src="js/jquery.dataTables.min.js"></script> <script type="text/javascript" src="js/TableTools/TableTools.js"></script> <script type="text/javascript" src="ZeroClipboard/ZeroClipboard.js"></script> <script type="text/javascript"> $(document).ready(function() { TableToolsInit.sSwfPath = "ZeroClipboard.swf"; oTable = $('#sortable').dataTable({ "bRetrieve": true, "bProcessing": true, "sScrollX": "100%", "sScrollXInner": "110%", "bScrollCollapse": true, "bJQueryUI": true, "sPaginationType": "full_numbers", "sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>' }); }); </script> </head> <body bgcolor="#e0e0e0"> <div class="main"> <div class="body"> <div class="body_resize"> <div class="liquid-round"> <div class="top"><span><h2>Details</h2></span></div> <div class="center-content"> <div style="overflow-x:hidden; min-height:400px; max-height:600px; overflow-y:auto;"> <div class="demo_jui"><br /> <table cellpadding="0" cellspacing="0" border="0" class="display" width="100%" id="sortable"> <thead> <tr> <th>First Name</th> <th>MI</th> <th>Last Name</th> <th>Street Address</th> <th>City</th> <th>State</th> <th>Zip</th> <th>DOB</th> <th>Gender</th> <th>Spouse Name</th> <th>Spouse Date of Birth</th> <!-- this part is generated with the php, when removed, datatables works just fine with the rest of the page --> <th>Dependent Child Name 1</th> <th>Dependent Date of Birth 1</th> <th>Dependent Child Name 2</th> <th>Dependent Date of Birth 2</th> <th>Dependent Child Name 3</th> <th>Dependent Date of Birth 3</th> <th>Dependent Child Name 4</th> <th>Dependent Date of Birth 4</th> <th>Dependent Child Name 5</th> <th>Dependent Date of Birth 5</th> <th>Dependent Child Name 6</th> <th>Dependent Date of Birth 6</th> <th>Dependent Child Name 7</th> <th>Dependent Date of Birth 7</th> </tr> </thead> <tbody> <tr> ... UPDATE REGARDING COMMENTS/ANSWERS I have received a number of responses indicating the number of headers may not match the field count in the body. As I mention below, eliminating the php script below altogether would eliminate 5+ fields in the header and without question throw the count match off balance. This DOES NOT however cause an error and in fact "resolves" the issue in that datatables functions properly (even though there is NO header record for 5+ fields in the body.

    Read the article

  • ASP.NET MVC jQuery autocomplete with url.action helper in a script included in a page.

    - by Boob
    I have been building my first ASP.NET MVC web app. I have been using the jQuery autocomplete widget in a number of places like this: <head> $("#model").autocomplete({ source: '<%= Url.Action("Model", "AutoComplete") %>' }); </head> The thing is I have this jQuery code in a number of different places through my web app. So i thought I would create a seperate javascript script (script.js) where I could put this code and then just include it in the master page. Then i can put all these repeated pieces of code in that script and just call them where I need too. So I did this. My code is shown below: In the site.js script I put this function: function doAutoComplete() { $("#model").autocomplete({ source: '<%= Url.Action("Model", "AutoComplete") %>' }); } On the page I have: <head> <script src="../../Scripts/site.js" type="text/javascript"></script> doAutoComplete(); </head> But when I do this I get an Invalid Argument exception and the autocomplete doesnt work. What am I doing wrong? Any ideas?Do i need to pass something to the doAutoComplete function?

    Read the article

  • Prevent jQuery Tabs to bind to <ul> elements below the main <ul> element.

    - by Shiki
    Hi, I have this HTML: <div id="mytabs"> <ul id="main-tabs"> <li><a href="">Link</a></li> <li><a href="">Link</a></li> <li class="filter"> <ul id="filter-controls"> <li><a href="">Filter by something</a></li> <li><a href="">Filter by something</a></li> <li><a href="">Filter by something</a></li> </ul> </li> </ul> </div> And I set it to a tabbed control: $('#mytabs').tabs(); My problem is jQuery UI also converts the <li> elements in <ul id="filter-controls"> into tabs. Is there a way to instruct jQuery UI to only set the <li> children of <ul id="main-tabs"> as the tabs? Note: I am currently in no position to change <ul id="filter-controls" into a non-ul element.

    Read the article

  • using getScript to import plugin on page using multiple versions of jQuery

    - by mikez302
    I am developing an app on a page that uses jQuery 1.2.6, but I would like to use jQuery 1.4.2 for my app. I really don't like to use multiple versions of jQuery like this but the copy on the page (1.2.6) is something I have no control over. I decided to isolate my code like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head> <script type="text/javascript" src="jquery-1.2.6.min.js> <script type="text/javascript" src="pageStuff.js"> </head> <body> Welcome to our page. <div id="app"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script> <script type="text/javascript" src="myStuff.js"> </div> </body></html> The file myStuff.js has my own code that is supposed to use jQuery 1.4.2, and it looks like this: (function($) { //wrap everything in function to add ability to use $ var with noConflict var jQuery = $; //my code })(jQuery.noConflict(true)); This is an extremely simplified version, but I hope you get the idea of what I did. For a while, everything worked fine. However, I decided to want to use a jQuery plugin in a separate file. I tested it and it acted funny. After some experimentation, I found out that the plugin was using the old version of jQuery, when I wanted it to use the new version. Does anyone know how to import and run a js file from the context within the function wrapping the code in myStuff.js? In case this matters to anyone, here is how I know the plugin is using the old version, and what I did to try to solve the problem: I made a file called test.js, consisting of this line: alert($.fn.jquery); I tried referencing the file in a script tag the way external Javascript is usually included, below myStuff.js, and it came up as 1.2.6, like I expected. I then got rid of that script tag and put this line in myStuff.js: $.getScript("test.js"); and it still came back as 1.2.6. That wasn't a big surprise -- according to jQuery's documentation, scripts included that way are executed in the global context. I then tried doing this instead: var testFn = $.proxy($.getScript, this); testFn("test.js"); and it still came back as 1.2.6. After some tinkering, I found out that the "this" keyword referred to the window, which I assume means the global context. I am looking for something to put in place of "this" to refer to the context of the enclosing function, or some other way to make the code in the file run from the enclosing function. I noticed that if I copy and paste the code, it works fine, but it is a big plugin that is used in many places, and I would prefer not to clutter up my file with their code. I am out of ideas. Does anyone else know how to do this?

    Read the article

  • Where exactly are shortcuts to the Windows Modern UI apps stored in windows 8?

    - by Journeyman Geek
    I'm trying to mess around with starting up modern UI applications from the desktop and various other wierdness. While I've been digging, I can't seem to work out where exactly the shortcuts to windows modern UI apps are stored. With my classic desktop applications they are in C:\ProgramData\Microsoft\Windows\Start Menu\Programs. The modern UI stuff dosen't turn up though. Where are the shortcuts to the modern UI apps stored so that the start screen can find them?

    Read the article

  • How to get jQuery EasyUI datagrid and treegrid to load in background?

    - by f1r3br4nd
    I am trying build a jQuery EasyUI datagrid or treegrid out of a large query. Apparently the database takes long enough to respond that I get the "a script on this page may be busy" popup. Moreover, the entire browser (Firefox) locks up while it's waiting. I thought the whole point of AJAX was to load stuff unobtrusively. I've looked through the tutorials and documentation for EasyUI but it's not clear to me how to force a datagrid to load in the background. There are some similar unanswered questions asked on the EasyUI forums. Do I need to override the loader property of datagrid? If so, does anybody know where I can get a non-obfuscated version of the default loader function so I can be sure I understand what it's supposed to do before I write my own? Also, if I need asynchronous datagrids and datatrees with sorting and filtering features, is jQuery EasyUI the wrong library for doing this simply and cleanly? Is there some alternative jQuery library people would recommend? Thank you.

    Read the article

  • how to create an function using jquery live? [Solved]

    - by Mahmoud
    Hey all i am trying to create a function that well keep the user in lightbox images while he adds to cart, for a demo you can visit secure.sabayafrah.com username: mahmud password: mahmud when you click at any image it well enlarge using lightbox v2, so when the user clicks at the image add, it well refresh the page, when i asked about it at jcart support form they informed me to use jquery live, but i dont know how to do it but as far as i tried this code which i used but still nothing is happening jQuery(function($) { $('#button') .livequery(eventType, function(event) { alert('clicked'); // to check if it works or not return false; }); }); i also used jQuery(function($) { $('input=[name=addto') .livequery(eventType, function(event) { alert('clicked'); // to check if it works or not return false; }); }); yet nothing worked for code to create those images http://pasite.org/code/572 Update 1: i have done this function adding(form){ $( "form.jcart" ).livequery('submit', function() {var b=$(this).find('input[name=<?php echo $jcart['item_id']?>]').val();var c=$(this).find('input[name=<?php echo $jcart['item_price']?>]').val();var d=$(this).find('input[name=<?php echo $jcart['item_name']?>]').val();var e=$(this).find('input[name=<?php echo $jcart['item_qty']?>]').val();var f=$(this).find('input[name=<?php echo $jcart['item_add']?>]').val();$.post('<?php echo $jcart['path'];?>jcart-relay.php',{"<?php echo $jcart['item_id']?>":b,"<?php echo $jcart['item_price']?>":c,"<?php echo $jcart['item_name']?>":d,"<?php echo $jcart['item_qty']?>":e,"<?php echo $jcart['item_add']?>":f} }); return false; } and it seems to add to jcart but yet it still refreshes

    Read the article

  • Jquery UI Dialog - when opened IE7 Browser moves instantly to the bottom of the page

    - by Truegilly
    Hello, i have been working on a new .net MVC site and have integrated some of the awesome jquery UI components. ive been testing it in IE8, FF, opera and Chrome and all looks well. Once I test in IE7, surprisingly its the dialogs that are causing a problem. basically what’s happening is that one you user clicks to open a dialog the page will scroll immediately to the bottom of the page. This is especially bad if the page is quite long. this only happens in IE7 (and probably 6 but im not even going there!). I have spend a few hours reading forums and it seems im not the only one. I have created a dirty hack which im not keen on but it does work. onclick="SignIn(); <% if(ModelHelperClass.CheckForOldIEVersion() == true) Response.Write("window.scrollTo(0, 0);"); %> return false;"> has anyone else had this issue and resolved it without resorting to dirty hacks ? im using jquery-ui-1.8.custom.min.js and jquery-1.4.2.min.js any help is most appreciated Truegilly

    Read the article

  • First tab doesnt show with Jquery UI Tabs using Cufon

    - by BoulderDave
    I'm using Cufon to render the font for my Jquery Tabs. A strange problem I'm finding is that with the first tab, the text isn't rendered. If I remove Cufon, the text is there, or if I remove jquery tabs (so that its just html list items) the text is there (properly rendered by cufon). There seems to be timing issue with the loading I think, where cufon renders the text, but then the jquery tabs css is applied, and perhaps they are 'breaking' each other. Anybody had this issue? $(document).ready(function() { Cufon.replace('.tab'); }); <ul class="tabnav"> <li><a href="bottoms.html" title="Bottoms"><div class="tab">Bottoms</div></a></li> <li><a href="tops.html" title="Tops"><div class="tab">Tops</div></a></li> <li><a href="skirts.html" title="Skirts"><div class="tab">Skirts</div></a></li> <li><a href="dresses.html" title="Dresses"><div class="tab">Dresses</div></a></li> <li><a href="shoes.html" title="Shoes"><div class="tab">Shoes</div></a></li> </ul>

    Read the article

  • Using jQuery tools from within GWT -- is there a way to allow exchanges?

    - by culov
    I have a GWT web-app with a nearly full page Google map window. Inside the the map, I have infowindows which include links. What I want to do is use jquery tools overlays (http://flowplayer.org/tools/overlay/apple.html) to open the overlay and display it on top of the map once the link inside the info window is clicked. Now, the link source is generated dynamically, and it is hosted on a different server, so i have to open it in an iframe and set the source of the iframe before it opens. this seems simple enough since i only have 1 iframe on the page: function changeSource(url){ $("#menuIFrame").attr("src",url); } To call this before opening the overlay (which is done on mouse release), i create the following element in the google maps infowindow via GWT: <a href="http://whatever.com/menu/" onClick="changeSource('http://whatever.com/menu/');" rel=#menu"> View menu </a> Jquery tools works by opening whatever div has the id assigned to the value of 'rel', but because i have my javascript/jquery on my LandingPage.html in GWT, there appears to be some sort of disconnect between the two because the changeSource function is never called AND the overlay is never added to the window. Here's my app: http://truxmapper.appspot.com/ As you can see, the other overlays will work fine, but once you click an infowindow and try to view the menu, it will simply use the href to open the url in that window. Does anyone know of a solution that will allow me to accomplish my goal? Thanks!

    Read the article

  • jQuery-UI How-to stop realoding the tabs

    - by user256034
    I'm using jQuery UI tabs functionality to load tab content via Ajax. But I need to load the tabs only once. At the first request. <div id="tabContainer"> <ul> <li><a href="/Home/Tab1">Tab1</a></li> <li><a href="/Home/Tab2">Tab2</a></li> <li><a href="/Home/Tab3">Tab3</a></li> </ul> </div> I hooked up the select event. I'm able to see if the content is already loaded or not.But I'm missng the point how to stop jQuery from sending the request. $("#tabs").tabs({ select: function(event, ui) { if (ui.panel.innerHTML != '') { //What to do here to stop jQuery from sending the request. return; } } });

    Read the article

  • C#: Populating a UI using separate threads.

    - by Andrew
    I'm trying to make some sense out of an application Ive been handed in order to track down the source of an error. Theres a bit of code (simplified here) which creates four threads which in turn populate list views on the main form. Each method gets data from the database and retrieves graphics from a resource dll in order to directly populate an imagelist and listview. From what Ive read on here (link) updating UI elements from any thread other than the UI thread should not be done, and yet this appears to work? Thread t0 = new Thread(new ThreadStart(PopulateListView1)); t0.IsBackground = true; t0.Start(); Thread t1 = new Thread(new ThreadStart(PopulateListView2)); t1.Start(); Thread t2 = new Thread(new ThreadStart(PopulateListView3)); t2.Start(); Thread t3 = new Thread(new ThreadStart(PopulateListView4)); t3.Start(); The error itself is a System.InvalidOperationException "Image cannot be added to the ImageList." which has me wondering if the above code is linked in some way. Iis this method of populating the UI recommended and if not what are the possible complications resulting from it?

    Read the article

  • jQuery UI Dialog Issue With IE

    - by Dan Appleyard
    I am using the new jQuery 1.3.2 and jQuery-ui-1.7 libraries along with the UI Dialog. I have a div tag with several form elements (textbox, checkbox, etc.) in it. Upon page load, jQuery shows the div as a dialog. This works absolutely fine in FF, but in IE, the height of the div is wrong. It is just showing the title bar a bit of the content. I explicitly set the height when creating the div. If I set the height option after opening the dialog, the height is corrected, but the content is blank (shows the top third of a textbox). If I allow the dialog to be resizable, if you resize it in IE it works fine, but I don't want to force IE users to resize just to see the contents. Any ideas? Here is the code I use to create the dialog: $('#dialogDiv').dialog({ bgiframe: true, height: 400, width: 620, modal: true, draggable: true, resizable: false, close: function(event, ui) { if($('#agree').val() != '1') location.href = 'somepage.html'; } });

    Read the article

  • jQuery plugin design pattern for using `this` in private methods?

    - by thebossman
    I'm creating jQuery plugins using the pattern from the Plugins Authoring page: (function($) { $.fn.myPlugin = function(settings) { var config = {'foo': 'bar'}; if (settings) $.extend(config, settings); this.each(function() { // element-specific code here }); return this; }; })(jQuery); My code calls for several private methods that manipulate this. I am calling these private methods using the apply(this, arguments) pattern. Is there a way of designing my plugin such that I don't have to call apply to pass this from method to method? My modified plugin code looks roughly like this: (function($) { $.fn.myPlugin = function(settings) { var config = {'foo': 'bar'}; if (settings) $.extend(config, settings); this.each(function() { method1.apply(this); }); return this; }; function method1() { // do stuff with $(this) method2.apply(this); } function method2() { // do stuff with $(this), etc... } })(jQuery);

    Read the article

  • Having trouble using jQuery's .animate() to animate a div from left to right, right to left?

    - by Alex
    Hello, I seem to be having difficulties using jQuery .animate() to animate an absolutely positioned div from right to left on a button click, and left to right on another button click. I was wondering if you would be willing to help me understand what I'm doing wrong? Thanks. Below is my relevant CSS, HTML, and jQuery code. I can click the #moveLeft button and it wil indeed animate it to the left, but when I click the #moveRight button, nothing happens. Where am I going wrong? Thanks!! CSS #scorecardTwo { position:absolute; padding:5px; width: 300px; background-color:#E1E1E1; right:0px; top:0px; display:none; } HTML text text Left Right jQuery $("#scorecardTwo").fadeIn("slow"); $("#moveLeft").bind("click", function() { var config = { "left" : function() { return $(this).offset().left; }, "right" : function() { return $("body").innerWidth() - $K("#scorecardTwo").width(); } }; $("#scorecardTwo").css(config).animate({"left": "0px"}, "slow"); $(this).attr("disabled", "disabled"); $("#moveRight").attr("disabled", ""); }); $("#moveRight").bind("click", function() { var config = { "left" : function() { return $(this).offset().left; }, "right" : function() { return $("body").innerWidth() - $K("#scorecardTwo").width(); } }; $("#scorecardTwo").css(config).animate({"right" : "0px"}, "slow"); $(this).attr("disabled", "disabled"); $("#moveLeft").attr("disabled", ""); });

    Read the article

  • Keep the current Jquery accordion pane open after asp.net postback?

    - by Xaisoft
    I have a jquery accordion on an asp.net aspx weppage. Inside the panes, I have asp.net buttons. When I click on the button, the pane I was in, closes and reloads the page, defaulting to the first pane. I don't mind the reload, but is there a way to keep the current pane open after the reload. Right now, I am just calling accordion() on a div with the id of accordion.

    Read the article

  • Combining mousedown and mousemove events together with Javascript (JQUERY?)

    - by webzide
    Dear experts, I would like to combine a the mousedown and mousemove and mouseup events together. Basically the application of this would be making a UI for selecting elements. Like selecting icons in windows when the mouse is clicked down and as you move it, a dotted border dynamically moves with it. I know this is possible with the predefined UI of Jquery. But I am building a web application that requires the integration of this and would like to know the technique. I spend hours on this and it just doesn't work. here's is the code i have so far and the logic behind it: $(document).bind('mousedown', function (evt) { evt = (evt) ? evt : event; startX = evt.clientX; startY = evt.clientY; div = document.createElement("div"); div.style.position = "absolute"; div.style.left = startX + "px"; div.style.top = startY + "px"; div.style.border = "1px dotted #DDDDDD"; $(document).bind('mousemove', function(evt){ evt=(evt) ? evt: event; alert("TESTING OF THIS WORKS"); }); }); $(document).bind('mouseup',function(evt) { var evt = (evt) ? evt : event; var endX = evt.clientX; var endY = evt.clientY; difX = (endX - startX); difY = (endY - startY) if ((difX || difY) > 0) { div.style.width = difX + "px"; div.style.height = difY + "px"; document.body.appendChild(div); } $(this).unbind('mousemove'); }); As you can see I have placed an event binding of mousemove into the event function of mousedown so that it can only be invoked when the mouse is down. but the problem is, once that event is binded, it does not come off. The borders does not move dynamically as expected. Maybe my logic is entirely messed up. If anyone could point me the the right direction that would be great. THanks in advance.

    Read the article

  • Anyone have ideas for solving the "n items remaining" problem on Internet Explorer?

    - by CMPalmer
    In my ASP.Net app, which is javascript and jQuery heavy, but also uses master pages and .Net Ajax pieces, I am consistently seeing on the status bar of IE 6 (and occasionally IE 7) the message "2 items remaining" or "15 items remaining" followed by "loading somegraphicsfile.png|gif ." This message never goes away and may or may not prevent some page functionality from running (it certainly seems to bog down, but I'm not positive). I can cause this to happen 99% of the time by just refreshing an .aspx age, but the number of items and, sometimes, the file it mentions varies. Usually it is 2, 3, 12, 13, or 15. I've Googled for answers and there are several suggestions or explanations. Some of them haven't worked for us, and others aren't practical for us to implement or try. Here are some of the ideas/theories: IE isn't caching images right, so it repeatedly asks for the same image if the image is repeated on the page and the server assumes that it should be cached locally since it's already served it in that page context. IE displays the images correctly, but sits and waits for a server response that never comes. Typically the file it says it is waiting on is repeated on the page. The page is using PNG graphics with transparency. Indeed it is, but they are jQuery-UI Themeroller generated graphics which, according to the jQuery-UI folks, are IE safe. The jQuery-UI components are the only things using PNGs. All of our PNG references are in CSS, if that helps. I've changed some of the graphics from PNG to GIF, but it is just as likely to say it's waiting for somegraphicsfile.png as it is for somegraphicsfile.gif Images are being specified in CSS and/or JavaScript but are on things that aren't currently being displayed (display: none items for example). This may be true, but if it is, then I would think preloading images would work, but so far, adding a preloader doesn't do any good. IIS's caching policy is confusing the browser. If this is true, it is only Microsoft server SW having problems with Microsoft's browser (which doesn't surprise me at all). Unfortunately, I don't have much control over the IIS configuration that will be hosting the app. Has anyone seen this and found a way to combat it? Particularly on ASP.Net apps with jQuery and jQuery-UI? UPDATE One other data point: on at least one of the pages, just commenting out the jQuery-UI Datepicker component setup causes the problem to go away, but I don't think (or at least I'm not sure) if that fixes all of the pages. If it does "fix" them, I'll have to swap out plug-ins because that functionality needs to be there. There doesn't seem to be any open issues against jQuery-UI on IE6/7 currently... UPDATE 2 I checked the IIS settings and "enable content expiration" was not set on any of my folders. Unchecking that setting was a common suggestion for fixing this problem. I have another, simpler, page that I can consistently create the error on. I'm using the jQuery-UI 1.6rc6 file (although I've also tried jQuery-UI 1.7.1 with the same results). The problem only occurs when I refresh the page that contains the jQuery-UI Datepicker. If I comment out the Datepicker setup, the problem goes away. Here are a few things I notice when I do this: This page always says "(1 item remaining) Downloading picture http:///images/Calendar_scheduleHS.gif", but only when reloading. When I look at HTTP logging, I see that it requests that image from the server every time it is dynamically turned on, without regard to caching. All of the requests for that graphic are complete and return the graphic correctly. None are marked code 200 or 304 (indicating that the server is telling IE to use the cached version). Why it says waiting on that graphic when all of the requests have completed I have no idea. There is a single other graphic on the page (one of the UI PNG files) that has a code 304 (Not Modified). On another page where I managed to log HTTP traffic with "2 items remaining", two different graphic files (both UI PNGs) had a 304 as well (but neither was the one listed as "Downloading". This error is not innocuous - the page is not fully responsive. For example, if I click on one of the buttons which should execute a client-side action, the page refreshes. Going away from the page and coming back does not produce the error. I have moved the script and script references to the bottom of the content and this doesn't affect this problem. The script is still running in the $(document).ready() though (it's too hairy to divide out unless I absolutely have to). FINAL UPDATE AND ANSWER There were a lot of good answers and suggestions below, but none of them were exactly our problem. The closest one (and the one that led me to the solution) was the one about long running JavaScript, so I awarded the bounty there (I guess I could have answered it myself, but I'd rather reward info that leads to solutions). Here was our solution: We had multiple jQueryUI datepickers that were created on the $(document).ready event in script included from the ASP.Net master page. On this client page, a local script's $(document).ready event had script that destroyed the datepickers under certain conditions. We had to use "destroy" because the previous version of datepicker had a problem with "disable". When we upgraded to the latest version of jQuery UI (1.7.1) and replaced the "destroy"s with "disable"s for the datepickers, the problem went away (or mostly went away - if you do things too fast while the page is loading, it is still possible to get the "n items remaining" status). My theory as to what was happening goes like this: The page content loads and has 12 or so text boxes with the datepicker class. The master page script creates datepickers on those text boxes. IE queues up requests for each calendar graphic independently because IE doesn't know how to properly cache dynamic image requests. Before the requests get processed, the client area script destroys those datepickers so the graphics are no longer needed. IE is left with some number of orphaned requests that it doesn't know what to do with.

    Read the article

  • JQuery dialog momentairly displayed on page load

    - by Kevin Won
    I created a page that has a JQuery based dialog using the standard JQuery UI function. I do this with out of the box functionality of JQuery... nothing special at all. Here is my HTML for the dialog: <div id = "myDialog"> <!-- ... more html in here for the dialog --> </div> Then the JQuery called in javascript that transforms the <div> to a dialog: // pruned .js as an example of kicking up a JQuery dialog $('#myDialog').dialog({ autoOpen: false, title: 'Title here', modal: true } }); Again, plain-vanilla JQuery. So you start this wizard by clicking on a link on the parent page, and it then spawns a JQuery dialog which has a significant chunk of HTML that includes images, etc. As I continued developing this page, I started to notice that when I loaded the page in the browser that the <div> tags I was putting in that JQuery transforms into dialogs would very briefly be displayed. Then the page would act as expected. In other words, the dialog would not be hidden, it would be displayed briefly in-line in the page. Quite ugly and unprofessional looking! But after a split second, the page would render correctly and look just as I expected/wanted. Over time, as the page size grew, the time the page would remain incorrectly rendered grew. My guess is that the rendering engine of the browser is rendering the page as it is loading, then at the end it is kicking off the JQuery that will transform the <div> into a dialog. This JQuery function will then transform the simple <div> to a JQuery dialog and hide it (since I have the autoOpen property set to false). Some browsers <cough>IE</cough> display it longer than others. My large-ish dialog now causes the page to incorrectly render for about 1 second... YUCK! I came up with a resolution to this problem which works OK, but I'm wondering if someone knows of a better way.

    Read the article

  • jQuery DatePicker - How to highlight certain days every month?

    - by Sergio
    Hi I have a jquery datepicker which is renders the current date by default as a full calendar. Before this is rendered I get a list of days from the server via ajax of days that need to be highlighted for the current month. The code for this is as follows: $.get("Note/GetActionDates/?orgID=" + orgID + "&month=" + month +"&year=" + year, null, function(result) { RenderCalendar(result); }, "json"); function RenderCalendar(dates) { $("#actionCal").datepicker({ dateFormat: 'dd/mm/yy', beforeShowDay: function(thedate) { var theday = thedate.getDate(); if ($.inArray(theday, dates) == -1) { return [true, "", ""]; } else { return [true, "specialDate", "Actions Today"]; } } }); } This is all good, but I would like the highlighted dates to update when the user clicks to a different month. I can modify the jquery datepicker initialise code with the following code: onChangeMonthYear: function(year, month, inst) { //get new array of dates for that month $.get("Note/GetActionDates/?orgID=" + orgID + "&month=" + month + "&year=" + year, null, function(result) { RenderCalendar(result); }, "json"); } But this doesn't seem to work. Could anyone show me what I'm doing wrong? Thanks! :) UPDATE - Working Code Thanks for the help! I have tweaked the code from petersendidit as follows and it now works. Gonna add a little more code to remove duplicate dates from the dates array but aside from that its all good. $("#actionCal").datepicker({ dateFormat: 'dd/mm/yyyy', beforeShowDay: function(thedate) { var theday = thedate.getDate() + "/" + (thedate.getMonth() + 1) + "/" + thedate.getFullYear(); if ($.inArray(theday, actionCalDates) == -1) { return [true, "", ""]; } else { return [true, "specialDate", "Actions Today"]; } }, onChangeMonthYear: function(year, month, inst) { dateCount = 0; getDates(orgID, month, year); } }); function getDates(orgID, month, year) { dateCount += 1; if (dateCount < 4) { $.ajax({ url: "Note/GetActionDates/", data: { 'orgID': orgID, 'month': month, 'year': year }, type: "GET", dataType: "json", success: function(result) { actionCalDates = actionCalDates.concat(result); getDates(orgID, month + 1, year); getDates(orgID, month - 1, year); } }); } }

    Read the article

  • How to trigger a postback using JQuery Droppable plugin ?

    - by Sandeep K Ram
    Hi, This is my script for the draggable and droppable <script type="text/javascript"> $(function() { $(".Source li").draggable({ appendTo: "body", helper: "clone", revert: "invalid" }); $(".Destination ").droppable({ activeClass: "ui-state-default", hoverClass: "ui-state-hover", accept: ".Source li", drop: function(event, ui) { $(this).find(".placeholder").remove(); $("#Hf1").val(ui.draggable.text()); $("#TxtItemId").val($("#Hf1").val()); } }); }); </script> Now I want to access the value of the "TxtItemId" control in the code-behind through a postback. How do I go about doing this ? BTW, this is for a scenario where a person will drag an item from a panel into a shopping cart and I need to capture the Id of the dropped item and trigger a postback after the drop to update the quantity of that item in the cart.

    Read the article

< Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >