[Solved] Moving div on click [closed]

[ad_1] You can do it like this: $(“.layout_theme”).click(function(){ $(“.file_uploader”).animate({ left: $(this).offset().left – parseInt($(this).css(“margin-left”)) + “px”, top: $(this).offset().top + $(this).height() – parseInt($(this).css(“margin-top”)) + “px” }) }); Check it your here: http://jsfiddle.net/zd78e8a3/1/ 1 [ad_2] solved Moving div on click [closed]

[Solved] HTML Form Submit pass array to PHP [closed]

[ad_1] You can use hidden inputs: <input type=”hidden” name=”image_ids[]” value=”1″> <input type=”hidden” name=”image_ids[]” value=”2″> <input type=”hidden” name=”image_ids[]” value=”3″> Just create a new hidden input for each image id, with the same name image_ids[]. Note that when you append [] to the name of various input fields, these values are submitted as an array, in this … Read more

[Solved] How to get attribute of href on the basis of selected text? [closed]

[ad_1] Try this : put id for anchor tag <a id=”anchor1″ href=”https://stackoverflow.com/questions/25931155/site.com/register.php?mid=username&mode=bn&bid=1″> use below javascript <script> var href = document.getElementById(‘anchor1’).href; //get index of ? var indexStart = href.indexOf(‘?’); var indexLast = href.length; //get href from ? upto total length var params = href.substring(indexStart+1, indexLast); //get tokens with seperator as ‘&’ and iterate it var paramsArray … Read more

[Solved] Cannot style Jquery element using CSS

[ad_1] In your CSS you’ve #Main-button { width:200px; } but the JS is adding dynamic inline style based on content. So it’s having style attribute. So in terms of CSS specificity their CSS beats you. You must use !important in your rule to avoid overriding of your CSS. #Main-button { width:200px !important; } 0 [ad_2] … Read more

[Solved] Show value on title from clicked item with jQuery

[ad_1] ID of an element must be unique, so need to use class to group similar elements, also in the click handler you need to find the title element which is a descendant of the clicked li jQuery(‘#restaurant-menu-content-tab’).on(‘click’, ‘#res-menu-filters li’, function(e) { var value = jQuery(this).find(‘.menu-extend-title’).text(); jQuery(‘#menu-title-layout-text’).text(value); return false; }); <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js”></script> <div id=”restaurant-menu-content-tab”> <div … Read more

[Solved] turn this jquery into an if/else statement [closed]

[ad_1] Let’s break this into bare parts, and fix the indentation. Then use some static analysis to compact the if statements. <!–script for changing Number of Columns–> $(window).load(function(){ function oneColumnClick() { $(‘.IH_pINameRow’).removeClass(“floatLeft “); $(‘.IH_pINameRow’).addClass(“floatNone “); $(‘.odd’).removeClass(“leftMargin”); $(‘.even’).removeClass(“rightMargin “); $(‘.pI_nameText’).removeClass(“textAlignLeft textAlignRight”); $(‘.pI_nameText’).css(‘font-size’, ‘2em’); $(‘.pI_nameText’).addClass(“1col”); $(‘.pI_nameText’).removeClass(“2col”); $(‘label.twoColumn’).css(‘background-position’, ‘-104px -52px’); $(‘label.oneColumn’).css(‘background-position’, ‘-104px -26px’); } function twoColumnClick() { $(‘.IH_pINameRow’).removeClass(“floatNone … Read more

[Solved] Making a quiz in HTML and Javascript [closed]

[ad_1] This website is for people that intend to program or already do, I don’t believe asking for code is allowed. Anyways, you might be interested on Google Forms or Surveymonkey, two of the countless survey serving services for non-programmers. If you do intend to learn HTML and Javascript, you’ll definitely need more time, and … Read more

[Solved] jQuery multiply vars inside value [duplicate]

[ad_1] you forgot to concatinate the last string ”, so youre missing a “+” $(‘.customfield’).val(‘<?php echo $userdata[“id”] ?>,clicks,’+amount+’,’+cPrice+”); though you dont need the last string bit cause its empty anyway so you can just $(‘.customfield’).val(‘<?php echo $userdata[“id”] ?>,clicks,’+amount+’,’+cPrice); and you can concatinate as many variables as you want to in the docs you can read … Read more

[Solved] Quotes for values of html attributes [closed]

[ad_1] The escaped quotes match each other in the HTML string that you’re creating. The quotes are not “surrounding” +i+. They’re being used to end the string that begins with “<p id=\”element” and to begin the next string: “\”>Hello world, …” This is concatenating i between these two strings. So if i contains 0, the … Read more

[Solved] Facebook & Jquery – Share to show [closed]

[ad_1] If you’re using the Javascript SDK to publish stories, show the content in the callback response when a user shares content successfully: FB.ui( { method: ‘feed’, name: ‘Google’, link: ‘http://www.google.com/’, picture: ‘http://google.com/xyz.jpg’, caption: ‘Google Logo’, description: ‘Search away’ }, function(response) { if (response && response.post_id) { // YOUR CODE GOES HERE // e.g. $(“#some_div”).show(); … Read more