detach() vs remove()
Can somebody say what is the difference? #box { background-color: green; } var tt = $("#box").detach(); $(tt).appendTo("body"); // or var tt = $("#box").remove(); $(tt).appendTo("body"); In both situations - it will do the same. Cut and paste. So, what's the difference?
Anchors and subpages # and /#
Hello everyone, hope you are all doing fine. I am having an issue with a fullpage BootStrap design I'm using. It also has subpages, so I had to replace the anchors like #services with /#services (a dash in front) so the link also works on subpages. However, when on the main page now, in the navbar (bootstrap), the 'active' section doesn't lit up anymore due to the '/' before the anchor. I'm new to jQuery but I was hoping that jQuery could come to the rescue...
How to still active multi tabs in same page?
I have 2 tabs in a page same as http://demos.jquerymobile.com/1.4.2/tabs/ . Firstly, I select a menu from first tabs ("Use navbar for tabs" in demo) its class and color change to active. But,When I select a menu from second tabs ("Use inset listview for tabs" in demo) , Active menu that I selected from first tab change to inactive. So, Can I make it independently active between multi tab ? Thanks. P.S. i used jquery.mobile-1.4.5
Find and return the position in a list by data-attribute.
Hi, is it possible to search through a list and return the place in the list is resides; For example: https://jsfiddle.net/ysyxvtyp/279/ Search through the resultsBox list and look for the data-color="blue" if it exists return the eq() where it resides - in this case it would be 2. Thanks.
jQuery slidedown menu not closing correctly
Hi, I am building a site and am using a full overlay navigation and some jQuery. It works pretty good, however I have one problem. When you close the menu, it seems as if the mask (the grey background) disappears quicker than the text, making it look weird. Any ideas? I'm guessing that is has something to do with .slideUp()/.slideDown() operation. But not completely sure, and not sure what to edit. The navgation was originally taken from https://github.com/adtile/fixed-nav . The js is unchanged,
How to make loaded html document use only it's own css stylesheet?
Hi, I have a navigation bar on the left and when I click one of its buttons it loads another html doc in a div on the right. The problem is that the loaded document uses the main css file from index.html and I only want it to use another sub.css file for example. Is there anyway to make it use only the linked sub.css file or do I just have to add lots of additional classes on the main.css file? Here's the function: $("a").click(function () { event.stopPropagation(); event.preventDefault();
On click slidetoggle h4 but hide other ul close first
Hello, I have two lists. Now if you open one list the other doesn't close. How can I make: if you click on one h4 the other list close. How can I make this? thanks in advance the code is: <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <title></title> <style>ul{display: none;}</style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script> $(document).ready(function(){ $(".flip").click(function(){
Displaying different image after the page reloads
Hi Guys, How can I display different images after the page reloads? (The images have to be editable at the front end). I was thinking using the jQuery Cycle plugin and have set up the following code,however it doesn`t always displays a new image when I refresh the page. I was trying to add the random function, but I don`t think is correct. Here is my code so far: - how can I set this so it doesn`t fades every now and then, only when I refresh the page. Many thanks! <!DOCTYPE html> <html> <head> <title>JQuery
Is generated html dependent on the browser used ?
Hi, Sorry for my question but i completly new with jquery. The question is on the title. Thanks, Tackent.
Issue with Slick Carousel
Hi, So I have an Eventbrite API call that generates a bunch of divs. I want to make a slider out of those divs using Slick Carousel. When I set up the carousel manually, it works fine, but when I use my API loop it doesn't perform correctly. What the Slick Carousel plugin does is wrap the child divs in a way that creates the slider. It creates the new parent div like it should, but does not tuck the other divs underneath. Below is the code calling everything (I'm using Wordpress): // Enqueue Scripts
Binging data to jq grid on button click.
Hi Team, I am using jq grid with asp.net mvc4 and C#. I have a requirement to bind a jq grid with data on click of a button. Currently I did a sample which binds some static data to jq grid on page load itself. But I want to bind the data on click of a button once page loads. Please find by the below sample for reference that I did for referecnce. Quick response will be deeply appreciated. HTML jQuery(document).ready(function () { jQuery("#list").jqGrid( {
if(children(first, second).val() == "")
$("form#zzz input[type='button']").on("click", function(){ $(this).parent().submit(); }); $("form#test").on("submit", function(){ if($(this).children("textarea, input[type='text']").val() == "") alert("You need to feel up all fields.") else alert("OK"); }); <div id="comment"> <h2>Some comment</h2> <form id="test" onsubmit="return false"> Name: <br/> <input type="text"/> <br/> Comment: <br/> <textarea rows="5"
multiple datepicker instances
I have successfully implemented a datepicker following the examples in the documentation. To create multiple datepicker instances in one document I thought I could do something like: $(function dpInit(dpId) { $(dpId).datepicker({....}); }); However, how do I call dpInit? tia, cb
Can not put a variable of a txt file with tag html in a text element svg
Hi, I want to retrieve the text part between tag html from the load command. For this I use an svg file directly in my html page and the load command of jquery. If I download from a text file without html tag it works well: $ ("# DivA"). Load ("demo_test1.txt"); If I download from a file containing html tags this does not work. $ ("# DivA") load ("demo_test.txt # p2"); A remark in my example the "div" works in both casesBelow my file: demo_test.txt: ***************** <p id="p1" >It works fine</p>
How to setup active Accordion??
Hi guys, i need help using Accordion jQuery. I what to add a div code to the "active section". Example: only the title of the active section show an image and not the inactive sections. Can someone show me a simple code to do it?? thanks!
hy parseerror?
Hi, Why I am getting parseerror when I am not returning anything and I am just INSERTing? here is the code: $('#frmSurvey').submit(function (event) { event.preventDefault(); viewModel.loadPanelVisible(true); var formData = new FormData(); formData.append("customer_name", $("#txtName").dxTextBox('option', 'value')); formData.append("customer_email", $("#txtEmail").dxTextBox('option', 'value')); // formData.append("customer_birthday", $("#dateBirthday").dxDateBox('option',
Is there a way to trigger the language set on device?
Hello, I'm starting an application in three languages, but I would like to know how I could trigger the language used on the device of the user. Is there a simple way to do it with JQM ? Thanks in advance
Syntax Highlighter Problem?
SyntaxHighlighter is not defined... $(function(){ SyntaxHighlighter.Highlighter.all(); }); $(window).load(function(){ $('.flexslider').flexslider({ animation: "fade", controlNav: false, start: function(slider){ $('body').removeClass('loading'); } }); }); This code is right? please help me with this...
Div Expand and Collapse
Hi all, Problem is when I click on link addClass and removeClass working fine but all div's with class "box-panel" slideDown and slideUp at a time and that should not happen. One div should be show or hide instead of all I hope you got my point Script jQuery(document).ready(function () {
var topBoxA = jQuery('.box-top > a');
jQuery('.icon').addClass('iconplus');
jQuery(topBoxA).click(function () {
debugger;
if (jQuery(this).hasClass('iconplus')) {
jQuery(this).removeClass('iconplus');
How to div refresh on specific tab load
How to div refresh on specific tab load // Tabs $('#tabs').tabs({ fx: { opacity: 'toggle' } }); tab name #finance <script>$('#finance_result').load(code.php', function() { });</script>
if element has an image, wrap it and move it
I have a series of divs that may or may not contain an image. I need to check if each div has an image, and if it does, wrap the div, wrap the image, and move the wrapped image into the newly wrapped div (so I can have it float next to the original div). So from this: <div class="event">image text</div> <div class="event">text</div> to this: <div class="eventHolder" > <div class="imageHolder" >image></div> <div class="event" >text</div> </div> <div class="event">text</div> I feel like I'm close
Opposite to $("#resultsBox *:hidden").size();
Hi, what would be the opposite to: var a1 = $("#resultsBox *:hidden").size(); I have tried doing the opposite, substituing var a1 = $("#resultsBox *:visible").size(); Thanks in advance. Thanks.
convert json object with spaces
Hi! I have some JSON to deal with. The given structure i have is like this. ... "days": [ { "date": "2017-01-01", "weekday": "Sunday", "workfree day": "Yes", }, ... What I try to do is to use jQuery and Ajax to get an output of some of the values onto a web page.It works fine with for example: var test1 = data.dagar[dayNr].date; (works fine) But.. One of the nodes have a blankspace: workfree day" - I haven't figured out how to solve that in my output.. var test2 = data.dagar[dayNr].workfree
Filterable inside custom select Fixed
I am trying to "fix" the filter box on a custom select to the top of the screen when scrolling up the list. I have very long lists and when the user edits a record the value selected can be way down the list. I need the search box to remain at the top so it is available to the user. I have tried using libraries like Sticky-Headers, but they do not seem to work. Is there a native way to make the filter box stick? Thanks, Darren
Call function when app page loads
Hello: I am developing a mobile app using Cordova, but right now I'm simply working on the HTML, JS, and CSS files. When the app opens, it will first just come to my "home" section. I have a button that will open the left Panel, and from there, if I click the "Programs" item, then it will fire my function which displays my listview (it does this in this HTML page at the "<div id="divShow"></div>") . Here is my home section: <section data-role="page" id="home"> <aside data-role="panel" data-display="overlay"
ms-Dropdown
Hello, I'm trying to use this https://github.com/marghoobsuleman/ms-Dropdown and I have a few questions that I couldn't find answers in the documentation. First, my option list has a dynamic "style='display:none;'" that depends on other regular dropdowns (without the plugin applied). Can Initiate the msdropdown only on the visible items and refresh it when things change ? Secondly, each "option" in the select list has an ID and style, can I add it to the generated MSdropdown in a way that each
jquery html need help
$(document).ready(function(){ $(".iconClass").click(function(){ $("#iconSearch").html("<div class=\"btn-group\"><input type=\"search\" id=\"searchInput\"/><span id=\"searchClear\" class=\"glyphicon glyphicon-remove-circle\"></span></div>"); }); $("#searchClear").click(function(){ $("#searchInput").val(''); }); }); HTML CODE <div id="iconSearch"> <i class="fa fa-2x fa-search iconClass"></i> <!--Text --> <div id="desText"> <p>Click search icon</p> </div> </div> When I run this code
change datepicker
hi to all. sorry for my english. I found the datepicker calendar. It's very nice. One queston I have. Is it possible to block some Dates myself, so the user can't pick them? Thanks in advance.
Onboarding/welcome screen using page div?
For many apps, on the first launch, it will show a screen welcoming the user or introducing the app's features. If this is not the first run, the just go straight to the main screen. Do we create 2 div with data-role="page", for example "main" and "welcome"? Then use $.mobile.navigate(page_id) to direct to the right page? Where would be the appropriate place to insert the JavaScript codes to check and direct to the right screen page automatically? By default, jQM will jump to the first data-role
Drag only the horizontal scrollbar amount
I am trying to use jQuery Ui to drag an overflowing child div, this div does drag but further than I like. I only want it to drag the scroll-able amount. I have looked at scroll and containment but no luck. Hopefully this codepen will show you want I mean - http://codepen.io/seanjacob/pen/RKKEyO
Supplying a Radix
PARSEINT REQUIRES A RADIX: Please make sure you are supplying a radix for all parseInt(). How can i solve this with this code? please help me... // Fun Facts function count($this){ var current = parseInt($this.html(), 10); current = current + 1; /* Where 50 is increment */ $this.html(++current); if(current > $this.data('count')){ $this.html($this.data('count')); } else { setTimeout(function(){count($this)}, 50); } } $(".stat-count").each(function() { $(this).data('count', parseInt($(this).html(),
Creating single page, parallax style sites best practises
Hello, I'm getting more into front-end development, having been a PHP developer for a while, and am having a go at creating single page, parallax style sites. I was wondering what the current best standard / practise is for this For reference the kinds of affects I'm trying to emulate are similar to http://www.flyjetedge.com/ Thanks for any help.
Jquery show method ?
I am trying to using the div named hid , I have used the form statements in the div and I have hidden the div tag using css and I have used a button when I click the button then hidden div element should be shown, But I am not able to show the result after clicking on the button element too . can any one help me in finding the solution for the answer. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport"
jquery ui function not available. What am I missing here?
Hi. I want to use draggable. JQuery ui file was created with "download builder" and Interactions: "toggle all" selected. Files included on my index.html like this: <script src="assets/js/jquery-3.1.1.min.js"></script> <script src="assets/js/jquery-ui.min.js"></script> <script src="assets/js/app.js"></script> In app.js I have: (function($) { $(document).foundation(); $( ".song-dragger" ).draggable({ axis: "y" }); })(jQuery); In my /js/ folder I have: In console I get error: Uncaught TypeError:
Vertical scroll in div for fluid layouts
Here goes: I want to have a vertical scroll in a div for images and text on the tablet and desktop but not for mobile phones. This is my first responsive website... first question to a forum... excuse my ignorance. I've read up on how to make the scroll thingy happen but haven't found how to have it not happen for screens less than. If it's a bit of query/CSS stuff what is it and where do I put it?
image of which gallery was clicked
I have two divs each has a gallery class the first one have a few images and the second has a few images to get a click event of an image $('.gallery img').click(); how do I know if it is an image of the first gallery or of the second gallery?
Select row and column of a table.
Hi, in a loop I have to select the 4th td of a table. I've used this: var id = $('#miaTabella tr:eq(1) td:eq(4)').html() it works, but I use always the 2nd row. How can I change tr:eq(1) with the index of the loop? Some thing like this: for(i=0;i<10;i++) var id = $('#miaTabella tr:eq(i) td:eq(4)').html() Thanks in advance Tegatti
Why does "closest()" not work (here)?
Lets start with a sample page: http://www.thewindowsclub.com/winguard-pro-password-protect I want to get rid of the two lines inside the article which start with "RECOMMENDED:" Therefore I coded: $("RECOMMENDED:").closest("div").remove(); but this does not work. The command was told me to delete (only) the next <div> element above a certain string (here: "RECOMMENDED:") Whats wrong? Peter
datepicker and sortable tests hang on ppc64le
Hi All, I am trying to install (from source) an run the jquery unit tes on ppc64le and am getting an issue wherin the sortable and datepicker tests are hanging. Relevant version information is as below. bash-4.2# phantomjs --version 2.1.1 bash-4.2# node --version v6.2.1 bash-4.2# npm --version 3.9.3 This is the log I see >> 6 files lint free. Running "requirejs:js" (requirejs) task Running "qunit:files" (qunit) task Testing tests/unit/accordion/accordion.html ............................................OK
Delete value from select menu option from saved record
Hello, I think I'm missing something obvious. In my jsfiddle, when Radio Option 1 is clicked , the two drop down menu fields are required. When Radio Option 2 is clicked, the two drop down menus are hidden and their values, if any were selected, are removed. This works fine. My problem occurs when I edit a record. If I had clicked Radio Option 1 and then two options from the select menus; if I go back and edit the record and choose Radio Option 2, while the select options are removed in the form,
Next Page