JQuery hide and show doesnt work
Date : March 29 2020, 07:55 AM
To fix this issue I have been trying to make a updateable grid.Which means i show an icon on mouseover on click of that icon i show a new row with textboxes and hide the previous row then there is a an icon which saves the values using ajax.On Successfull completion of this ajax save process i make a new row of the data and replace the previous row with textboxes. , Have you tried using on() instead of mouseover()? E.g: jQuery('[rel="innerRows"]').on("mouseover", function (){
var spanId = jQuery(this).attr('spanid');
jQuery('[rel="innerSpans"]').hide();
jQuery('#edit_'+spanId).show();
});
|
JQuery: show() and hide() targeting more than one div doesn't work?
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , Its because, the way you have used the multiple-selector is wrong. Try, $("#foo,#foo1,#foo2,#foo3").show();
$(document).ready(function (){
$("#state").change(function() {
$("#foo,#foo1,#foo2,#foo3").toggle($(this).val() == "twoChoices");
});
});
|
Date : March 29 2020, 07:55 AM
this will help The purpose of classes is re-usability, if you want unique you can use ID. I suggest you to follow following pattern. :id => "Identifier_ModelName_Id"
o/p => "Identifier_Question_15"
|
Hide and show input doesnt work
Date : March 29 2020, 07:55 AM
Hope this helps I have the following code: var getInput = document.querySelector('.search-form')
var screenWidth;
var getWidth;
var bodyDisplay;
var display;
window.onresize = function(event) {
screenWidth = event.target.outerWidth;
};
function getCssProperty(elmId, property){
var elem = document.getElementById(elmId);
return window.getComputedStyle(elem,null).getPropertyValue(property);
}
function showInput(event) {
event.stopPropagation();
console.log(event.target.className);
if(event.target.className == "search-field form-fluid") return;
if(screenWidth === undefined){ //screenWidth is undefined but not null
screenWidth = document.documentElement.clientWidth;
}
console.log(screenWidth ,"b")
if(display === undefined && screenWidth > 500){ //display is undefined but not null
getInput.style.display = 'inline-block';
document.querySelector('.search-field').focus();
display = true; //setting display true as a flag
} else {
display=undefined; // making display undefined so that again on click if loop will execute
getInput.style.display = 'none';
}
}
document.getElementsByTagName('body')[0].onclick=function(event){
console.log("body")
display= true; // if true else loop in showInput will execute
showInput(event);
};
|
Hide and Show Code doesnt work on other forms
Tag : chash , By : Lauren Kirschner
Date : March 29 2020, 07:55 AM
hope this fix your issue You have to use the same actual Form3Admin instance to Show it. Keep Form3Admin sa instance as a class variable and use that instance when you want to show it. private void button2_Click(object sender, EventArgs e)
{
this.Hide();
sa.Show();
}
|