Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

There are only follow the three steps. it will getting a easy to set the popup background transparent. I tried to do this its good. Just copy and paste save the html file. put the code the warm server then only jquery file will work then it will open the popup. besides to use what you need.
<style> .blockbkg { background-color: black; opacity: 90%; filter:alpha(opacity=90); background-color: rgba(0,0,0,0.90); width: 100%; min-height: 100%; overflow: hidden; float: absolute; position: fixed; top: 0; left: 0; color: white; } .cont { background-color: white; color: black; font-size: 16px; border: 1px solid gray; padding: 20px; display:block; position: absolute; top: 10%; left: 35%; width: 400px; height: 400px; overflow-y: scroll; } .closebtn { width: 20px; height: 20px; padding: 5px; margin: 2px; float: right; top: 0; background-image: url(x.png); background-repeat: no-repeat; background-position:center; background-color: lightgray; display: block; } .closebtn:hover { cursor: pointer; } .normal { background-color: lightblue; width: 900px; min-height: 200px; padding: 20px; } </style>

Step:2

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript">
</script>

<script>
$(document).ready(function () {
$("#closebtn").click(function () {
$("#dlg").hide('800', "swing", function () { $("#bkg").fadeOut("500"); });
});
$("#opn").click(function () {
if (document.getElementById('bkg').style.visibility == 'hidden') {
document.getElementById('bkg').style.visibility = '';
$("#bkg").hide();
}
if (document.getElementById('dlg').style.visibility == 'hidden') {
document.getElementById('dlg').style.visibility = '';
$("#dlg").hide();
}
$("#bkg").fadeIn(500, "linear", function () { $("#dlg").show(800, "swing"); });
});

});
</script>

Step:3

<body> <div class="normal"> <h1>Modal Dialogs</h1> <p> This is an example of how to create <strong>modal dialog popup windows</strong> for your pages using javascript and CSS. Modal dialog popups are better than window-based popups, because a new browser window is not required and the user does not have to leave the page. This is great for when you need an easy way for the user to carry out a specific action on the same page and control the modality of the window. </p> <p><a href="#" id="opn">Click here</a> to display the javascript modal popup dialog!</p> </div> <div class="blockbkg" id="bkg" style="visibility: hidden;"> <div class="cont" id="dlg" style="visibility: hidden;"> <div class="closebtn" title="Close" id="closebtn"></div> <h1>Hello World!</h1> <p> This is a neat little trick to get a modal popup dialog box in your web pages without disturbing the user experience or dsitracting them with popup windows or new tabs... </p> <p> The <strong>popup dialog</strong> uses javascript (jQuery) and CSS to create a modal dialog that will retain focus over the parent window until it is closed. The trick is simple. We use block-elements (divs) to create the dialog window. The CSS rules for <em>position</em>, <em>float</em>, <em>top</em>, <em>left</em>/<em>right</em>, and <em>opacity</em> (or CSS3 transparency) allows us to create a semi-transparent div over the entire page, thereby creating the illusion of modalness. The other div then takes focus over the center of the window. </p> <img src="https://sheriframadan.com/examples/uploadit/uploads/50f00e1434e8b.jpg" width="200" height="252"> <p> We can also retain content view control over the modal dialog with the <em>overflow</em> CSS property. This means no matter what we place inside of our dialog window the content will remain inside of the defined bounds even if scrolling becomes necessary within the div. </p> </div> </div> </body> <html>
Read more ...

code is creating drop down menu using JavaScript. I can also used this code its working correctly. Its may be useful.

Step:1

Click here to download the jquery file.

<script type="text/javascript" src="JS/jquery.js"></script>
<script type="text/javascript">
 $(document).ready(function(){
 
 // This hides the menu when the page is clicked anywhere other than the menu.
  $(document).bind('click', function(e) {
   var $clicked = $(e.target);
      if (! $clicked.parents().hasClass("menu")){
          $(".menu dd ul").hide();
    $(".menu dt a").removeClass("selected");
   }

  });
  
  $(".menu dt a").click(function() {

   var clickedId = "#" + this.id.replace(/^link/,"ul");

          // Hides everything else that the current menu 
   $(".menu dd ul").not(clickedId).hide();

          //Toggles the menu.
   $(clickedId).toggle();

          //Add the selected class.
   if($(clickedId).css("display") == "none"){
    $(this).removeClass("selected");
   }else{
    $(this).addClass("selected");
   }

  });
  
// This function shows which menu item was selected in corresponding result place
  $(".menu dd ul li a").click(function() {
   var text = $(this).html();
   $(this).closest('dl').find('.result').html(text);
      $(".menu dd ul").hide();
  });

  
 });
</script>

Step:2

Its CSS class using this class and change the images and image path.


<style type="text/css">

 .menu dl{ margin-left:5px; }
 .menu dd, .menu dt, .menu ul 
 { margin:0px; padding:0px; }
 .menu dd { position:relative; }

 
 .menu dt a {background:#EEEEEE 
 url(Images/privacyOff.png) no-repeat scroll right center;
  display:block; width:40px; height:22px; cursor:pointer;}

 .menu dt a.selected{
  background:#EEEEEE url(Images/privacyOn.png) 
  no-repeat scroll right center;
 }
 .menu dt a span {
 cursor:pointer; display:block; padding:5px;}

 .menu dd ul { 
 background:#EEEEEE none repeat scroll 0 0; display:none;
  list-style:none; padding:3px 0; position:absolute;
  left:0px; width:160px; left:auto; right:0; 
  border:1px solid #656565; cursor:pointer;
  }
 .menu dd ul li{ 
 background-color:#EEEEEE; margin:0; width:160px;
 }
 .menu span.value { display:none;}
 .menu dd ul li a { 
 display:block; font-weight:normal; width:137px; 
 text-align:left; overflow:hidden; padding:2px 4px 3px 19px; 
 color:#111111; text-decoration:none;
 }
 .menu dd ul li a:hover{ 
 background:#656565; color:white; text-decoration:none; 
 }
 .menu dd ul li a:visited{ 
 text-decoration:none; 
 }
</style>


Step:3 

 Its a HTML code just code and past change some thing in your drop down menu list.

<html><head>
</head>

<body>
<div style="clear:both;">.</div>
 <div style="width:500px; margin:auto;">
  <h1 style="margin:20px 0;">Facebook menu Menus</h1>

 <div style="height:300px;">
   <div style="width:162px;">
       <dl style="" class="menu">
          <dt>
       <a class="" id="linkglobal" 
       style="cursor: pointer;"></a></dt>
     <dd>
               <ul style="display: none;" id="ulglobal">
                   <li><a href="#">My Account</a></li>
                   <li><a href="#">My Profile</a></li>
                   <li><a href="#">My Product</a></li>
                   <li><a href="#">My Feature</a></li>
             </ul>
          </dd>
       </dl>
   </div>
 </div>
  </div>
</body></html>
Output:
Read more ...

Scrollbar Colors customization                                         It's uncertain how many browsers are still supporting color scrollbars. I understand IE only supported it for one version, then dropped it with the next. However we will keep the code here for those who wish to learn from it. Add the following script within your head tag and change the color attributes to suit.

<style type="text/css">
body { scrollbar-arrow-color: ffffff; scrollbar-base-color:ffffff; scrollbar-dark-shadow-color: ffffff; scrollbar-track-color: ffffff; scrollbar-face-color: ffffff; scrollbar-shadow-color: ffffff; scrollbar-highlight-color: ffffff; scrollbar-3d-light-color: ffffff; }
</style>
Read more ...

This is one of the method to Change font color "onMouseOver" and "onMouseOut" using(CSS)

<style type="text/css">
<html>
<!-- Created on: 27/09/2012 -->
<head>
  <title></title>
</head>
<body>
 <table onmouseover="document.style.x.color='white'"  border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#008080" width="100%" height="34" bgcolor="#95BED4">
      <tr>
        <td onMouseOver="this.style.backgroundColor='#2172A1';  this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='#95BED4'" width="20%">
         <!-- <P> tag onMouseOver Color -->
  <p align="center"><b><font face="Verdana" color="#2172A1" onmouseover="this.style.color='white'" onmouseout="this.style.color='#2172A1'" size="2">Home</font></b></td>
      </tr>
    </table>
</body>
</html></style>

you can do it like this: make two classes in your stylesheet something like menuon and menuoff.

<style type="text/css">
td.menuon { background-color: #000000; color: #FFFFFF; }
td.menuoff { background-color: #FFFFFF; color: #000000; }
</style>

<td class="menuoff" onmouseover="className='menuon';" onmouseout="className='menuoff';">
</td>

<a href="#" style="text-decoration: none;" onmouseover="this.style.textDecoration = 'underline'" onmouseout="this.style.textDecoration = 'none'">asdasdasdads</a>


<p onMouseOut="this.style.color = 'black';" onMouseOver="this.style.color = 'red';" align="justify">
Your text here to change text on mouseover</p>
Read more ...

Avoid white background when iframe loads

Posted by Prince | 5:59:00 PM | | 0 comments »

Get Rid of  White Flash when iframe Loads:
                                                               To avoid white background while iframe loads, you can hides iframe until its fully loaded. You can use the following code snippets to hide iframe when its loading.
<iframe style="visibility:hidden;" onload="this.style.visibility = 'visible';" src="../iframe.html" > </iframe>
Read more ...

CSS Buttons

Posted by Prince | 4:29:00 PM | | 0 comments »

Create buttons with pure css:

The following buttons created by using only css. But it look like  an image button, here you can see a fading effect while mouse over the button. You can copy and use bellow code for css button with fading effect
<style type="text/css">
            
.button {
                font
:normal 18px sans-serif;
                text-decoration
:none;
                padding
:2px 12px 3px 12px;
                cursor
:pointer;
                position
:relative;
                overflow
:hidden;
                vertical-align
:middle;
                margin
:0 8px;
            
}
            a
.button {
                display
:inline-block;
                padding
:3px 14px 4px 14px;
            
}
            
.button span {
                position
:relative;
            
}
            
.style {
                color
:#92c564;
                border
:1px solid #111;
                background
:#2e2f31;
                background
:-moz-linear-gradient(top, #45494d, #161616);
                background
:-webkit-gradient(linear, left top, left bottom, from(#45494d), to(#161616));
                text-decoration
:none;
                -moz-border-radius
:4px;
                -webkit-border-radius
:4px;
                -moz-box-shadow
:rgba(0,0,0,.4) 0 0 8px;
                -webkit-box-shadow
:rgba(0,0,0,.4) 0 0 8px;
                text-shadow
:rgba(255,255,255,.6) 0 0 16px;
                -moz-transition
:all .2s linear;
                -webkit-transition
:all .2s linear;
            
}
            
.style span {
                position
:relative;
                z-index
:1;
            
}
            
.style .gradient {
                display
:block;
                width
:280%; height:280%;
                position
:absolute;
                bottom
:-150%;
                left
:-10%;
                background
:-moz-radial-gradient(center center, ellipse cover, rgba(255,255,255,0), rgba(255,255,255,0) 60%, rgba(255,255,255,.15) 61%, rgba(255,255,255,0));
                background
:-webkit-gradient(radial, 112 128, 0, 112 128, 196, from(rgba(255,255,255,0)), color-stop(60%, rgba(255,255,255,0)), color-stop(61%, rgba(255,255,255,.15)), to(rgba(255,255,255,0)));
                z-index
:4;
            
}
            button
.style .gradient {
                bottom
:-145%;
                left
:-17%;
                background
:-moz-radial-gradient(center center, ellipse cover, rgba(255,255,255,0), rgba(255,255,255,0) 60%, rgba(255,255,255,.14) 61%, rgba(255,255,255,0));
            
}
            
.style:hover, .style:focus {
                color
:#c5e4a9;
                text-shadow
:rgba(255,255,255,1) 0 0 12px;
            
}
        <
/style>
You can call the css class for any links and buttons in your page.
  <input value="Input" class="button style" type="button">
        
<button class="button style"><b class="gradient"></b><span>Button</span></button>
        
<a href="#" class="button style"><b class="gradient"></b><span>Anchor</span></a>
Live Sample:(Mouse over to feel difference)

  Anchor
Read more ...

Related Posts Plugin for WordPress, Blogger...