Ads 468x60px

Labels

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

Friday, January 8, 2016

How to create a element in jquery ?


Hi it's very simple download to jquery plugin and write some code Define a variable assign to value as like this
Jquery Code here
$(document).ready(function(){
// Create a HTML Tag Code here start
var newDiv = document.createElement('div');
$(newDiv).addClass('wraper');
$(newDiv).attr('data-role','wraperDivAttribute');
$(newDiv).html('This is wraper section');

$(newDiv).appendTo($("body")) ;// wraper div append to body
// Create a HTML Tag Code here end
});




Monday, July 6, 2015

How to create Accordion in simple jQuery code .

How to create Accordion in simple  jQuery code .

It's very simple now create simple html code and apply this simple jquery code as like this

HTML Code here
<div id="accordion">
    <h2><a href="#">Accordian Tab 1</a></h2>
    <div>
      <p>Accordian Tab 1 Data</p>
    </div>
    <h2><a href="#">Accordian Tab 2</a></h2>
    <div>
      <p>Accordian Tab 2 Data</p><br />
    </div>
    <h2><a href="#">Accordian Tab 3</a></h2>
    <div>
      <p>Accordian Tab 3 Data</p>
    </div>
    <h2><a href="#">Accordian Tab 4</a></h2>
    <div>
      <p>Accordian Tab 4 Data</p>
    </div>
  </div>
Css Code here
body {
  font-family: arial;
  font-size: 12px;
}
#accordion h2 {
  padding: 10px;
  margin: 0;
  border: 1px solid #4679bd;
  background-color: #4072b4;
  font-size: 14px;
  border-top: 3px solid #ccc;
}
#accordion h2 a {
  text-decoration: none;
  color: #ffffff;
}
#accordion div {
  padding: 0 10px;
  margin: 0;
  border: 1px solid #4679bd;
  color: #000;
}
Jquery Code here
$(document).ready(function() {
  $("#accordion div").hide();
  $("#accordion h2").click(function() {
    $(this).next("#accordion div").slideToggle("slow").siblings("#accordion div").slideUp("slow");
  });
});
Demo Jsfiddle

Friday, March 21, 2014

How to Creating Content Tabs with Pure CSS


Creating Content Tabs with Pure CSS it's very simple Try to this code
HTML Code here
<ul class="tabs">
<li> <input type="radio" checked name="tabs" id="tab1">
<label for="tab1"> tab 1</label>
<div id="tab-content1" class="tab-content"> Tab Content 1 </div> </li>

<li> <input type="radio" name="tabs" id="tab2"> <label for="tab2">
tab 2</label>
<div id="tab-content2" class="tab-content">
Tab Content 2 </div> </li>

<li>
<input type="radio" name="tabs" id="tab3">
<label for="tab3"> tab 3</label>
<div id="tab-content3" class="tab-content">
Tab Content 3 </div> </li>
</ul>
Css Code here

body, html {
height: 100%;
margin: 0;
-webkit-font-smoothing: antialiased;
font-weight: 100;
background:#90f286 ;
text-align: center;
font-family: arial;
}

.tabs input[type=radio] {
display:none;
}

.tabs {
width: 600px;
list-style: none;
position: relative;
padding: 0;
margin: 75px auto;
}

.tabs li{
float: left;
}

.tabs label {
display: block;
padding: 10px 20px;
border-radius: 2px 2px 0 0;
color: #000;
font-size: 24px;
font-weight: normal;
background: rgba(0,0,0,0.2);
cursor: pointer;
position: relative;
margin-top:3px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}

.tabs label:hover {
background: #0a71a5;
color:#fff;
top: 0;
}

[id^=tab]:checked + label {
background: #0a71a5;
color: white;
top: 0;
}

[id^=tab]:checked ~ [id^=tab-content] {
display: block;
}

.tab-content{
z-index: 2;
display: none;
text-align: left;
font-size: 20px;
padding-top: 10px;
background: #0a71a5;
padding: 15px;
color: white;
position: absolute;
top: 51px;
left: 0;
right:0;
box-sizing: border-box;
-webkit-animation-duration: 0.5s;
-o-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
animation-duration: 0.5s;
}

Demo Jsfiddle

Section have a fixed position when it hits the top of the screen

How to do this it's very simple here example see below .
Jquery Code
var oritop = -100;
$(window).scroll(function() {
var scrollt = $(this).scrollTop();
var elm = $(".scrollTopWindow");
if(oritop < 0) {
oritop= elm.offset().top;
}
if(scrollt >= oritop) {
elm.css({"position": "fixed", "top": 0, "left": 0});
}
else {
elm.css("position", "static");
}
});
Css here code as Sample
body{height:2000px}
.scrollTopWindow {
background-color: red;
width: 150px;
height: 100px;
color: white;
padding:20px;
}
HTML Code here
Some Content here
Some Content here
Some Content here
Some Content here
Some Content here
Some Content here
Some Content here
Some Content here
Some Content here
Some Content here
Some Content here
Some Content here
Some Content here
Some Content here
Some Content here
<div class = "scrollTopWindow"> Scroll top window and fix me ! </div>

Demo Jsfiddle

Wednesday, March 5, 2014

How to create a tooltips with jQuery

simple idea to create a tooltips
HTML
<input type="text" title="Here put your toottips text " />
CSS
.autoSugest{background:#fffdef;border:1px solid #cac6ad;
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;color:#7f7943;
display:none;
font-size:12px;
padding:7px 15px;
position:absolute;
min-width:100px;
-o-box-sizing:border-box;
-ms-box-sizing:border-box;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;}
.autoSugest:after{
content:url("../../images/tootl-tip-arrow.png"); height:8px;
width:11px;
position:absolute;
top:-13px;
left:38px}
Jquery
$.fn.autoSuggest = function(){ return this.each(function(index, elm){
if(!$(elm).is('[data-title]')){
$(elm).attr('data-title', $(elm).attr('title')).attr('title', '');
};

$(elm).on('focus', function(){
var element = $(this),
posTop = element.offset().top + element.outerHeight() + 10,
posLeft = element.offset().left,
toolTipWidth = element.outerWidth() > 90 ? element.outerWidth() : 250,
titleText = element.attr('data-title');
if(titleText && titleText != ''){
$('<div />', {class: 'autoSugest', text : titleText, css : {left: posLeft, top: posTop, maxWidth: toolTipWidth}}).appendTo('body').fadeIn();
}else{
return false;
}
});
$(elm).on('blur', function(){
$('.autoSugest').fadeOut(function(){
$(this).remove();
});
});
}); };
$(document).ready(function(){
    $('input[title]').autoSuggest(); });
 

Tuesday, July 9, 2013

One Click Select all Checkbox in Jquery


HTML
<label for="selectAll"><input type="checkbox" id="selectAll"> Select all</label>

<label for="ceckbox_1"><input type="checkbox" id="ceckbox_1" class="selectbox">Checkbox One</label>

<label for="ceckbox_2"><input type="checkbox" id="ceckbox_2" class="selectbox">Checkbox Two</label>

<label for="ceckbox_3"><input type="checkbox" id="ceckbox_3" class="selectbox">Checkbox Three</label>
Jquery
    $(document).ready(function(){
        $('#selectAll').on('click', function(){
            $('.selectbox').attr('checked', $(this).is(":checked"));
        });
    });

Demo Link

Thursday, November 1, 2012

Used to css Reset


Now Used To Css Reset for Best Result of your Website Layout
Used to Normal Css Reset of your Layout
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}
img{
    vertical-align:top;
}

If you are using HTML5 Than used to this css Reset
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
    margin:0;
    padding:0;
    border:0;
    outline:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
}

body {
    line-height:1;
}

article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
    display:block;
}

nav ul {
    list-style:none;
}

blockquote, q {
    quotes:none;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content:'';
    content:none;
}

a {
    margin:0;
    padding:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
}

/* change colours to suit your needs */
ins {
    background-color:#ff9;
    color:#000;
    text-decoration:none;
}

/* change colours to suit your needs */
mark {
    background-color:#ff9;
    color:#000;
    font-style:italic;
    font-weight:bold;
}

del {
    text-decoration: line-through;
}

abbr[title], dfn[title] {
    border-bottom:1px dotted;
    cursor:help;
}

table {
    border-collapse:collapse;
    border-spacing:0;
}

/* change border colour to suit your needs */
hr {
    display:block;
    height:1px;
    border:0; 
    border-top:1px solid #cccccc;
    margin:1em 0;
    padding:0;
}

input, select {
    vertical-align:middle;
}

Source By One
Source By Two