dhtml

Any way to shuffle content in multiple div elements

巧了我就是萌 提交于 2019-11-30 15:45:38
问题 I'm relatively new to Javascript and was wondering if there's a quick way to shuffle content that is contained in multiple <div> tags. For example <div id='d1'> <span>alpha</span> <img src='alpha.jpg'> </div> <div id='d2'> <span>beta</span> <img src='beta.jpg'> </div> <div id='d3'> <span>gamma</span> <img src='gamma.jpg'> </div> <button onclick='shuffle_content();'>Shuffle</button> After clicking on the button, I'd like the content in d1, d2, d3 to change places (for example maybe d3 would be

Any way to shuffle content in multiple div elements

落爺英雄遲暮 提交于 2019-11-30 15:03:34
I'm relatively new to Javascript and was wondering if there's a quick way to shuffle content that is contained in multiple <div> tags. For example <div id='d1'> <span>alpha</span> <img src='alpha.jpg'> </div> <div id='d2'> <span>beta</span> <img src='beta.jpg'> </div> <div id='d3'> <span>gamma</span> <img src='gamma.jpg'> </div> <button onclick='shuffle_content();'>Shuffle</button> After clicking on the button, I'd like the content in d1, d2, d3 to change places (for example maybe d3 would be first, then d1, then d2). A quick way to kind of move things around is to copy the first div element

code to set a select box option value as an object

℡╲_俬逩灬. 提交于 2019-11-30 04:47:31
in an html page i have got, i have a select box like this with values. <select onChange="return filler(this.value);"> <option value="{'name':'rajiv',age:'40'}">a</option> <option value="{'name':'mithun',age:'22'}">f</option> </select> i want to pass a javascript array or object as the option value. right now it is treating the option value as a string. i want it to be an array so that i can access it by this.value.name,this.value.age in the filler function. is this possible? You will not be able to store objects/arrays in the value attribute, however an option would be to use data-* attributes

Best server-side framework for heavy AJAX Java application

会有一股神秘感。 提交于 2019-11-30 03:39:49
There are zillions of Java web application frameworks. 95% were designed before the modern era of AJAX/DHTML-based development, and that means these new methods are grafted on rather than designed in. Has any framework been built from the ground up with e.g. GWT + Extjs in mind? If not, which framework has adapted best to the world of forms with dynamic numbers of fields and pages that morph client-side? Echo2 / Echo3 by Nextapp (www.nextapp.com) is totally awesome. Advantages over GWT: 1) It is not limited to a sub-set of java like GWT 2) It is easier (in my estimation) to learn 3) Has

Is there a good in-browser code editor? [closed]

╄→гoц情女王★ 提交于 2019-11-29 19:59:18
We've all seen in-browser rich text editors, which allow you to edit colored/styled text in a WYSIWYG manner. But what about code editors, which automatically highlight code based on language rules as you type? Think Eclipse in a textarea (but without the refactoring support). Do such things exist? I imagine scaling would be a problem - larger files would be difficult to edit efficiently. interstar CodeMirror comes with support for 60+ languages, and addons that implement more advanced editing functionality (autocompletion, code folding, configurable key bindings, search & replace, linter

TinyMCE API v4 windowManager.open - What widgets can I configure for the body option?

非 Y 不嫁゛ 提交于 2019-11-29 19:06:05
I would like to fill the body of a modal dialog with custom HTML, generated by Javascript. The documentation for this method is mostly empty. I have only found examples for loading an external file or adding a textbox . Is there a documentation for the available types? More specifically, is there a type to add general markup to the body of a dialog from a Javascript variable? After I beautified the minified version of tinymce, i found that these may be some of the body types for windowManager.open. I'm not sure how to use them all, as all this info was gathered through trial and fail. Since

Custom dropdown box using javascript and css

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 16:25:32
Is it possible to create a custom dropdown box using javascriit and css. for which i need to place a background-image for dropdown box using javascript If yes or no ? if yes . give any suggestion ? without using JQuery You can check out jQTransform Here is a good tutorial on creating custom drop-down . JQTransform (as suggested by Olafur) is sufficient for me. But if you need more control such as adding icons, it's worth looking at the tutorial. This might be overkill; but SproutCore gives you input elements composed from images instead of from native HTML elements. There are probably other

How to create a modal popup using JavaScript? [closed]

邮差的信 提交于 2019-11-29 13:06:30
How to create a modal popup window with background with gray color using JavaScript and CSS? Can anyone show me an example? I would recommend the jQuery one... http://jqueryui.com/demos/dialog/ You can look into creating a JQuery dialog ; I believe this will get you the modality you're looking for. I do not think an actual popup window is a solution you want. HI, You can use two divs for this purpose. The first div contains all your main page contents and the second one is for disabling the contents. When you fire the event make the second div fill all the UI and it should be on top of the

Best Javascript drop-down menu? [closed]

做~自己de王妃 提交于 2019-11-29 03:23:49
I am looking for a drop-down JavaScript menu. It should be the simplest and most elegant accessible menu that works in IE6 and Firefox 2 also. It would be fine if it worked on an unnumbered list ( ul ) so the user can use the page without JavaScript support. Which one do you recommend and where can I find the code to such a menu? I think the jquery superfish menu is fantastic and easy to use: http://users.tpg.com.au/j_birch/plugins/superfish/ Javascript is not required , and it is based on simple valid ul unorder lists. A List Apart - Dropdowns I'd use a css-only solution like the above so the

jQuery and appending large amounts of HTML

杀马特。学长 韩版系。学妹 提交于 2019-11-29 02:23:39
I have come to find that using jQuery to create HTML client-side can be a huge performance booster if done properly. I use AJAX returning JSON to retrieve dynamic content and then I build the relevant HTML and insert it using jQuery. The first time I messed with this technique I found that the string concatenator in IE's JavaScript performed really slowly so that building a dynamic table with more than 50 or so rows performed terribly. var shtml = '<table>'; for (var i = 0; i < 100; i++) { shtml += '<tr><td>A bunch of content</td></tr>'; } shtml += '</table>'; $('#myTable').append(shtml); Then