javascript and css problem

JavaScript and client side scripting.

Moderator: General Moderators

javascript and css problem

Postby avibitton » Tue Jul 17, 2012 8:28 am

Hi

i have a problem with javascript , im working on mobile orientation . so what i need to do its when its 90 degress so show #div1 and hide #div2
that part of the code:

<script>
makeWeatherSided = function(){
myOrientation = window.orientation==90 || window.orientation==-90 ? 0 : 1;
var temp = myOrientation;
if( myOrientation){
$("#naming").removeClass("naming_sided");
$("#drop2").removeClass("drop_sided");
$("#drop").removeClass("drop_sided");

}
else {
$("#drop2").removeClass("drop_sided");
$("#drop").addClass("drop_sided");
$("#drop2").addClass("drop_sided");
$("#naming").addClass("naming_sided");
}
</script>

but from reason whic i dont know , when im trying to hide the div drop2 .side_drop(thats the css when onside)

another quastion i have ,my css of the div when onside look like that :
.small #drop2.drop_sided{

width: 430px;
height: 178px;
min-width:300px;
text-align:right;
background-color:#413839;
margin:0px auto;
border:1px solid orange;
margin-top:-214px;
display:none;

}
if i want to do action on this css how do i use it in jquery or javascript? , i tried to do something like :
$(" .small #drop2.drop_sided").fadeOut("slow");(didnt work of course) but i guess i cant use all this long name of css object , so how i can use the name of the css object in this case?

THX Avi .
avibitton
Forum Newbie
 
Posts: 18
Joined: Sat Jul 14, 2012 4:35 pm

Return to Javascript

Who is online

Users browsing this forum: No registered users and 2 guests