Mariusz Kuta | webMASTAH.pl
webMASTAH CAMP #1 | 27.02.2014
Every website looks so AWESOME!
stackoverflow.com/questions/20283098 • 11.2013
user3032819: What is the main difference between JavaScript and jQuery. I know the minor difference like jQuery is high performance more reliable.
stackoverflow.com/questions/17621564 • 07.2013
user2577204: I want to create browser editor like ms word for browser.for that what should I used javascript or jquery? Which is better in performance wise javascript or jquery?
stackoverflow.com/questions/3677140 • 09.2010
johnny: For example, can I take this script and mix this JavaScript with jQuery's document.ready instead of relying on onload?
stackoverflow.com/questions/18887742 • 09.2013
user2310209: I am poor knowledge in jquery. I got string as "109:00AM" from that how to get first letter such as 1. Could you please help me.
stackoverflow.com/questions/7943804 • 10.2011
lamwaiman1988: I want to learn html5 in order to write some games. I realized people include some JQuery code inside the game. So I head over and check JQuery and found that JQuery have some relationship with Javascript. Should I learn Javascript before learning JQuery?
$(el).addClass('foo');
el.classList.add('foo');
$(el).removeClass('foo');
el.classList.remove('foo');
$(el).hasClass('foo');
el.classList.contains('foo');
$(el).toggleClass('foo');
el.classList.toggle('foo');
$(el).hide();
el.style.display = 'none';
$(el).show();
el.style.display = '';
$(el).css('color', 'red');
el.style.color = 'red';
$(el).attr('href');
el.getAttribute('href');
$(el).attr('rel', 'author');
el.setAttribute('rel', 'author');
$(el).removeAttr('href');
el.removeAttribute('href');
$(el).hover(function() {
$(this).animate({
color: 'red', 'border-color': 'red'
}, 400);
}, function() {
$(this).animate({
color: 'white', 'border-color': 'white'
}, 400);
});
.el {
color: white;
border-color: white;
transition: all .4s linear;
}
.el:hover {
color: red;
border-color: red;
}
$(el).animate({ left: '+= 100px' });
.el.animate {
transform: translateX(100px);
}
$(el).effect('shake');
+ jQuery UI (~30kB minified and gzipped)
@keyframes shake {
0%, 100% {
transform: translateX(0);
}
10%, 30%, 50%, 70%, 90% {
transform: translateX(-10px);
}
20%, 40%, 60%, 80% {
transform: translateX(10px);
}
}
.shake {
animation: shake 1s;
}
<input id="checkbox-1" type="checkbox" />
<label for="checkbox-1">Click!</label>
input {
display: none;
}
input + label {
padding-left: 1em; position: relative;
}
input + label:before {
content: '\f0c8'; font-family: FontAwesome;
position: absolute; left: 0; top: 0;
}
input:checked + label:before {
content: '\f14a';
}
input[type=radio] + label:before {
content: '\f111';
}
input[type=radio]:checked + label:before {
content: '\f058';
}
<ul class="carousel">
<li><a href="#"><img src="img1.jpg" alt="" /></a></li>
<li><a href="#"><img src="img2.jpg" alt="" /></a></li>
<li><a href="#"><img src="img3.jpg" alt="" /></a></li>
</ul>
.carousel {
display: inline-block; overflow: hidden; position: relative;
}
.carousel > li {
position: absolute; top: 0; left: 0;
animation: carousel 9s linear 0s infinite;
}
.carousel > li:first-child { position: relative; }
.carousel > li:nth-of-type(2) { animation-delay: -6s; }
.carousel > li:nth-of-type(3) { animation-delay: -3s; }
@keyframes carousel {
0%, 20%, 100% { transform: translateX(0); z-index: 5; }
33.33%, 53.33% { transform: translateX(-100%); z-index: 0; }
66.67%, 86.67% { transform: translateX(100%); z-index: 0; }
}
<div class="tabs">
<input type="radio" name="tab" id="tab1" checked />
<input type="radio" name="tab" id="tab2" />
<div class="labels">
<label for="tab1">Tab 1</label>
<label for="tab2">Tab 2</label>
</div>
<div class="container">
<div>Content 1</div>
<div>Content 2</div>
</div>
</div>
.tabs > input { display: none; }
.tabs .container > div { height: 0; overflow: hidden; }
.tabs > input:nth-of-type(1):checked ~ .container div:nth-of-type(1),
.tabs > input:nth-of-type(2):checked ~ .container div:nth-of-type(2) {
height: 100%;
}
.tabs > input:nth-of-type(1):checked ~ .labels label:nth-of-type(1),
.tabs > input:nth-of-type(2):checked ~ .labels label:nth-of-type(2) {
background: #fff; color: #2c3e50;
}
<a href="#tickets" class="button">Zgłoś swój udział!</a>
<div class="modal" id="tickets">
<div class="modal-content">
<!-- content -->
</div>
</div>
.modal {
position: fixed; top: 0; left: 0; right: 0; bottom: 0;
opacity: 0; visibility: hidden; z-index: 111;
}
.modal:target {
opacity: 1;
visibility: visible;
}