Skip to content

Instantly share code, notes, and snippets.

View joviczarko's full-sized avatar
🎯
Focusing

Jović Žarko joviczarko

🎯
Focusing
View GitHub Profile
@joviczarko
joviczarko / fonts.less
Last active August 29, 2015 14:23
Loading multiple font-face with LESS
//** Relative path to files
@font-path: 'font/path/';
//** A default mixin to be used for fonts.
.fontface(@family, @filename-base, @weight, @style, @svgID){
@font-face {
font-family: '@{family}';
src: url('@{font-path}@{filename-base}.eot');
src: url('@{font-path}@{filename-base}.eot?#iefix') format('embedded-opentype'),
url('@{font-path}@{filename-base}.woff2') format('woff2'),
@joviczarko
joviczarko / custom.js
Created June 6, 2016 10:52
Reinitialize google maps inside accordion (or tab). This case is for wp-google-maps plugin
jQuery(document).on('click', '.accordion', function(){
//Functionality of the accordion here
//Google Maps fix
google.maps.event.trigger(MYMAP.map, 'resize');
});
@joviczarko
joviczarko / custom.js
Created September 2, 2016 10:21
A synced principle for Owl Carousel, so you can make one single, and other with thumbnails. This one is example for videos.
jQuery(document).ready(function($) {
var $sync1 = $(".big-images"),
$sync2 = $(".thumbs"),
flag = false,
duration = 300;
$sync1.owlCarousel({
items: 1,
margin: 10,
nav: false,
dots: false
@joviczarko
joviczarko / index.html
Last active September 10, 2016 14:52
Testing the page setup. If everything is OK it will Write HTML, jQuery, and will show basic responsivnes (twitter bootstrap)
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#msgid").html("This is Hello World by JQuery");
});
</script>
This is Hello World by HTML
@joviczarko
joviczarko / custom.js
Last active September 10, 2016 15:22
Full screen splash screen
(function($) {
$('#toggle').click(function() {
$(this).toggleClass('active');
$('#overlay').toggleClass('open');
});
//Jumbotron scroll button click (there is also hide function bellow to hide it after scroll)
var height_jumbotron_scroll = $(window).height()/2+100;
@joviczarko
joviczarko / style.css
Created September 13, 2016 21:51
Setting bootstrap navbar height (Best way for it. This way you preserve all needed functions.)
nav.navbar {
padding: 30px 0;
}
@joviczarko
joviczarko / 0_reuse_code.js
Created September 14, 2016 10:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@joviczarko
joviczarko / content-archive.php
Created September 21, 2016 07:03
Right way of calling the featured image on WordPress archive page
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<?php endif; ?>
@joviczarko
joviczarko / gist:b4fd93e5631b42f9271c5366b0a7c8f6
Created September 21, 2016 10:32
Do something after scrolling certain amount
function home_navbar_toggle() {
if ($(window).scrollTop() > 100) {
$('nav.navbar-home').addClass('nav-scrolled');
}
else {
$('nav.navbar-home').removeClass('nav-scrolled');
}
};
@joviczarko
joviczarko / style.scss
Created September 29, 2016 09:16
Link sass mixin
$transition_link: all 0.3s ease;
@mixin link ($link, $visited, $hover, $active) {
& {
color: $link;
transition: $transition_link;
&:visited {
color: $visited;
}
&:hover {