logo
down
shadow

Open the closest modal of jQuery clicked element


Open the closest modal of jQuery clicked element

By : user2956079
Date : November 22 2020, 10:54 AM
fixed the issue. Will look into that further I'm having an issue with having the closest modal pop up according to the a tag that was clicked. Not understanding why my jQuery is not working. , Try this. I hope this will help you.
code :
$("a.code").click(function(event){
   $(this).parent().find(".bs-example-modal-lg").modal("show");
  });


Share : facebook icon twitter icon
Traversing to the element closest to the element clicked jquery

Traversing to the element closest to the element clicked jquery


By : user6401927
Date : March 29 2020, 07:55 AM
like below fixes the issue I have this kind of setup in my html , since jquery is tagged... using jquery
code :
$('.toggle-advanced').click(function(){
    $(this).parents('ul.normal').siblings('ul.advanced').toggle();
});
$('.toggle-advanced').click(function(){
    $(this).parents('.grp').find('ul.advanced').toggle();
});
$('.normal').on('click', '.toggle-advanced', function(){
   $(this).parents('.grp').find('ul.advanced').toggle();
});
Return value from Bootstrap model to the element which is clicked to open modal

Return value from Bootstrap model to the element which is clicked to open modal


By : OlivierM
Date : March 29 2020, 07:55 AM
hope this fix your issue You can add a class pressedModal on the element pressed in order to open the modal.
Access that element with this class from modal, and then remove this class on modal close:
code :
$(document).on('click', '#btnModel', function() {
    $(this).addClass('pressedModal'); 
    $('#myModal').modal('show');
  });
$(document).on('click', '#button_in_modal', function() {
    var buttonPressed = $('.pressedModal');
    // do your stuff
});

$(document).on('click', '#close_modal', function() {
    var buttonPressed = $('.pressedModal');
    buttonPressed.removeClass('pressedModal');
});
When element clicked, find closest element relative to this element with another class and toggle it

When element clicked, find closest element relative to this element with another class and toggle it


By : wuutoshi
Date : March 29 2020, 07:55 AM
I wish this help you I am missing something here. When the row with the class one is clicked, I want to find only the closest row with the class two and then toggle (show/hide) it. , Something like this:
code :
$(".one").on('click', function() {
    $(this).nextAll('.two:first').toggle(); 
});
How do I hide the closest element to the element that was clicked without jQuery?

How do I hide the closest element to the element that was clicked without jQuery?


By : Henry
Date : March 29 2020, 07:55 AM
may help you . If fave_icon is a class then you have to place dot (.) before the class name as part of the selector.
Change var heart = trashcan.closest("fave_icon");
code :
function trash(event, trashcan){
 event.stopPropagation();
 if (trashcan.getAttribute('src') == "Iconos/tacho.png"){
    trashcan.src = "Iconos/warning.png"; //this works ok
    var heart = trashcan.closest('button').querySelector('.fave_icon');
    heart.style.visibility = "hidden";
  }
}
<button class="accordion">
  <div>
    <img src="Iconos/heart.png" onclick="fav(event,this);" alt="Fave" class="fave_icon">
  </div>
  <div>
    <img src="Iconos/tacho.png" onclick="trash(event,this);" alt="Delete" class="delete_icon">
  </div>
</button>
Getting closest input value from clicked element with jQuery

Getting closest input value from clicked element with jQuery


By : MiniMo
Date : March 29 2020, 07:55 AM
This might help you I have the following markup:
Related Posts Related Posts :
  • Jquery and create html on the fly
  • jQuery Validation not validating on button click
  • Jquery Draggable/Droppable appending multiple divs
  • jQuery selector not working properly. Possible Sizzle bug?
  • enable anchor in twitter bootstrap modal
  • jQuery keydown : Wait for previous event to finish
  • why magnific popup ajax box closes if clicked on content
  • JQPlot pie charts "jqplotDataClick" event fires multiple times
  • Show div as the page scrolls on div height
  • Keypress event for ajax call does not work
  • responsive/fluid jQGrid with Twitter Bootstrap
  • IE10 does not seem to fire load event
  • Remove tipTip tool tip
  • jquery datepicker changing unavailable dates in one instance
  • TableTools plugin export buttons are not working
  • Prepopulate jquery token input textbox
  • Open a fancybox link with ajax
  • Getting jQuery and AngularJS content assist / auto-complete in eclipse for standalone HTML "file"
  • TR alternate background colour with unequal number of TD
  • DATATABLE jQuery TH and TD alignment
  • Jquery UI Convert Select's to Range Slider
  • Change text in text field according to link that has been clicked
  • Animate addClass + removeClass transitions?
  • knockout ajax call data-BIND
  • How do I create a variable with a number based on an element's number position using jquery?
  • Prevent fixed position element from flickering during jQuery animation
  • points are not visible clearly in nvd3 ghaph
  • How to write a regular expression for IP address format
  • Animate 3 DIVs from right to left when page is loading.
  • How to pivot columns in free jqgrid 4.15.4
  • the jquery method works fine but when made as a function not working
  • Show/hide text doesn't work when targeting link within div
  • multiple autocomplete search input fields
  • Display image in cell using Jquery jTable
  • jQuery and Wordpress - Scripts not working
  • flickering when mouse over, .hover() show/hide div(s)
  • Using Django's JSONResponseMixin to respond to AJAX requests
  • Unable to render charts using Wicked PDF
  • Style to dynamically created elements
  • hover not working for items in list
  • Keep server session alive automatically based on activity / input, using JQuery
  • jQuery load() taking a long time
  • Change / Exchange values in textboxes on text change in jquery
  • Unslider arrow code overriding slider options
  • what is the traditional way of sorting search results?
  • Do the action when the DIV comes in the display area of the browser with jQuery
  • jQuery slideshow overlapping CSS ribbon
  • JQuery animate function dont work
  • problems charts jquery highcharts
  • How to reset the select box values in Jquery sumoselect Multi select plugin
  • css absolute position on top of another element
  • How use jQuery String variable in html body
  • Get a row from table in view on modal bootstrap using codeigniter
  • How to make the effect of a div that covers an other div when scrolling?
  • Data binding using a button
  • How do i replace all dot in string to Underscore?
  • grab non-sibling element with jquery
  • Select a word and click it
  • Trigger modal instead redirect to /users/sign_in path, Rails 4 with devise
  • Combining Parent theme JS and CSS
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org