hiding a form depending if its visible or not, :visible check is not working


baylisscg
HOME ยป Programming Languages

I have this code to check if a span is hidden or visible depending on the value it will show or hide, the event is triggered when a user clicks a button:


$('form').on('click', '#agregar', function(){
// var p = $('#panel');
//var a = $('#agregar');
if($('#panel').is(':visible')){
$('#panel').hide();
$('#agregar').val('Mostrar Forma');
alert('ocultar');
}else {
//if($('#panel').is(':hidden')){
$('#panel').show();
$('#agregar').val('Ocultar Forma');
alert('mostrar');
}
});

the problem is that even if its visible it will never hide it


Related to : hiding a form depending if its visible or not, :visible check is not working
hiding a form depending if its visible or not, :visible check is not working
Programming Languages

I have this code to check if a span is hidden or visible depending on the value it will show or hide, the event is triggered when a user clicks a button:


$('form').on('click', '#agregar', function(){
// var p = $('#panel');
//var a = $('#agregar');
if($('#panel').is(':visible')){
$('#panel').hide();
$('#agregar').val('Mostrar Forma');
alert('ocultar');
}else {
//if($('#panel').is(':hidden')){
$('#panel').show();
$('#agregar').val('Ocultar Forma');
alert('mostrar');
}
});

the problem is that even if its visible it will never hide it

Nice solution for hiding all visible DIV elements on the page, then restoring only the ones that were visible before
Programming Languages

I'm trying to make a jQuery script that will hide all the visible elements on the page,
and then after someone hits a button, make all the elements that were hidden appear again.


I know I can use the .is(':visible') selector on every single divider and store the ones that are visible, then use .hide(); on all of those. Finally, I know I can then use .show(); on them again when someone clicks my button.


But I was wondering if there is a nicer way to do this.


I imagine hiding all elements in one sweep won't be a big problem (possibly something like $(document).hide() wil

visible/not visible depending on stage size???
Programming Languages

visible/not visible depending on stage size???
 
im trying to set an if statement that says
if the stage height is less than 800, then the movieclip is visible, else it's not visible
i thought it would be something like this, but it's not working. Do i need it inside the stage resize listener?
Code:
if (Stage.height < 800){
        mc1.visible = true;
        mc2._visible = true;
}else{
&nbs
Making text box and check box invisible/visible depending on user action
Programming Languages

Hey,
I am trying to do something on one of my forms..
Basically, i have a past and present checkbox, start date and leave date. Now if the user clicks on the "present" checkbox i want the leave date checkbox to vanish and if clicked again i want to re-appear..
Take a look at this page:-
http://www.judgethejob.com/vinny/submit-review/
now you can see at the moment i have the checkboxes past, present and 2 text boxes beneath. Can i do this?
Regards


HD Wallpapers
3D
3D Abstract
City
Celebrities
Indian Celebrities
Cars
Travel
Girls
Animals Birds
Movies
Sports
Black White
Nature
Planes
Anime
Food Drink
Dreamy Fantasy
Architecture
Games
Space
Holidays
Flowers
Love
Artistic
Baby
Beach
Bikes Motorcycles
Macro
Computers
Vector
Funny
Army
Textures
Brands
Misc
Music
Other
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .