I am working on a project which has 2 pages.
1) Index and 2) Settings
I have button to close an element and hide it on Settings page. The issue is, I want to hide the elements on Index page when I click on close in Settings page and select save. I am unable to achieve the same. Any help would be appreciated. Most of the solutions I found are just re-directing to other page using Jquery but I want to trigger an event and not just re-direct.
I have created a codepen for the same : http://codepen.io/crazycoder775/pen/pNYJOw
$(".list_sbar li").click(function(e) {
if ($(this).outerWidth() - 34 <= e.offsetX)
$(this).remove();
});
$(".list_sbar li").click(function(e) {
if ($(this).outerWidth() - 34 <= e.offsetX)
$(this).remove();
});
$(document).ready(function(){
$("#hide").click(function(){
$(".test1").hide();
});
$("#show").click(function(){
$(".test1").show();
});
});
$(document).ready(function(){
$("#hide2").click(function(){
$(".test2").hide();
});
$("#hide3").click(function(){
$(".test3").hide();
});
});
In the above codepen, I have 3 div's and 2 close buttons, on click on any close button, the respective div will be appended a hide class.