Parakket Care

Parakeet care guide
Parakeet Breeding Parakeet breeding demands correct preparing
The parakeet is really a kind of little, long-tailed parrot. The term parakeet really refers to num
Parakeet care
The African and Asian Parakeet loved ones is created up of five typical
Children adore the thought of getting a pet bird particularly a parakeet

  • Share/Bookmark

Betta Fish Care

New Betta Fish care, offering quality informations on betta fish

Check it at Betta Fish Care

  • Share/Bookmark

Cockatiel Care

  • Share/Bookmark

Toggle Text

Let's say you have a link to show more options which expands a list of options. It's says "more options". It's easy to toggle those options with .toggle() or .slideToggle(), but the text remains the same. To toggle the text too...

$("#more-less-options-button").click(function() { var txt = $("#extra-options").is(':visible') ? 'more options' : 'less options'; $("#more-less-options-button").text(txt); $("#extra-options").slideToggle();
});

Display Image Next To Each Tag

<?php
$posttags = get_the_tags(); // Get articles tags
$home = get_bloginfo('url'); // Get homepage URL // Check tagslug.png exists and display it
if ($posttags) { foreach($posttags as $tag) { $image = "/images/tag-images/$tag->slug.png"; if (file_exists("images/tag-images/$tag->slug.png")) { echo '<a href="' . $home . '/tag/' . $tag->slug . '" /><img title="' . $tag->name . '" alt="' . $tag->name . '" src="' . $image . '" /></a>'; // If no image found, output something else, possibly nothing. } else { echo '<p>Not found</p>'; } }
}
?>

This code belongs inside the loop. It will look in a specific directory for any images that match the slugs of article tags, display them and link them to the relevant tag archive.

Display Image Next To Each Tag

<?php
$posttags = get_the_tags(); // Get articles tags
$home = get_bloginfo('url'); // Get homepage URL // Check tagslug.png exists and display it
if ($posttags) { foreach($posttags as $tag) { $image = "/images/tag-images/$tag->slug.png"; if (file_exists("images/tag-images/$tag->slug.png")) { echo '<a href="' . $home . '/tag/' . $tag->slug . '" /><img title="' . $tag->name . '" alt="' . $tag->name . '" src="' . $image . '" /></a>'; // If no image found, output something else, possibly nothing. } else { echo '<p>Not found</p>'; } }
}
?>

This code belongs inside the loop. It will look in a specific directory for any images that match the slugs of article tags, display them and link them to the relevant tag archive.

Calculate Distance Between Mouse and Element

(function() { var mX, mY, distance, $distance = $('#distance span'), $element = $('#element'); function calculateDistance(elem, mouseX, mouseY) { return Math.floor(Math.sqrt(Math.pow(mouseX - (elem.offset().left+(elem.width()/2)), 2) + Math.pow(mouseY - (elem.offset().top+(elem.height()/2)), 2))); } $(document).mousemove(function(e) { mX = e.pageX; mY = e.pageY; distance = calculateDistance($element, mX, mY); $distance.text(distance); }); })();

This code will calculate the distance between the mouse cursor and the center of an element. This can be useful for triggering a function when the mouse is within a certain distance of an element. Or, you can base the value of a property, such as the width, height, or opacity of the element, on the proximity of the mouse cursor.

Calculate Distance Between Mouse and Element

(function() { var mX, mY, distance, $distance = $('#distance span'), $element = $('#element'); function calculateDistance(elem, mouseX, mouseY) { return Math.floor(Math.sqrt(Math.pow(mouseX - (elem.offset().left+(elem.width()/2)), 2) + Math.pow(mouseY - (elem.offset().top+(elem.height()/2)), 2))); } $(document).mousemove(function(e) { mX = e.pageX; mY = e.pageY; distance = calculateDistance($element, mX, mY); $distance.text(distance); }); })();

This code will calculate the distance between the mouse cursor and the center of an element. This can be useful for triggering a function when the mouse is within a certain distance of an element. Or, you can base the value of a property, such as the width, height, or opacity of the element, on the proximity of the mouse cursor.

Hexagon With Shadow

<div class="hexagon"><span></span></div>
.hexagon { width: 100px; height: 55px; position: relative;
}
.hexagon, .hexagon:before, .hexagon:after { background: red; -moz-box-shadow: 0 0 10px rgba(0,0,0,0.8); -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.8); box-shadow: 0 0 10px rgba(0,0,0,0.8);
}
.hexagon:before, .hexagon:after { content: ""; position: absolute; left: 22px; width: 57px; height: 57px; -moz-transform: rotate(145deg) skew(22.5deg); -webkit-transform: rotate(145deg) skew(22.5deg); transform: rotate(145deg) skew(22.5deg);
}
.hexagon:before { top: -29px;
}
.hexagon:after { top: 27px;
}
.hexagon span { position: absolute; top: 0; left: 0; width: 100px; height: 55px; background:red; z-index: 1;
}

Diagonal Graph Paper Gradient

#example-gradient { height: 200px; margin: 0 0 20px 0; background-color: #eaeaea; background-size: 20px 20px; background-image: -webkit-repeating-linear-gradient(45deg, rgba(0, 191, 255, .5), rgba(0, 191, 255, .5) 1px, transparent 1px, transparent 15px), -webkit-repeating-linear-gradient(-45deg, rgba(255, 105, 180, .5), rgba(255, 105, 180, .5) 1px, transparent 1px, transparent 15px); background-image: -moz-repeating-linear-gradient(45deg, rgba(0, 191, 255, .5), rgba(0, 191, 255, .5) 1px, transparent 1px, transparent 15px), -moz-repeating-linear-gradient(-45deg, rgba(255, 105, 180, .5), rgba(255, 105, 180, .5) 1px, transparent 1px, transparent 15px); background-image: -o-repeating-linear-gradient(45deg, rgba(0, 191, 255, .5), rgba(0, 191, 255, .5) 1px, transparent 1px, transparent 15px), -o-repeating-linear-gradient(-45deg, rgba(255, 105, 180, .5), rgba(255, 105, 180, .5) 1px, transparent 1px, transparent 15px); background-image: repeating-linear-gradient(45deg, rgba(0, 191, 255, .5), rgba(0, 191, 255, .5) 1px, transparent 1px, transparent 15px), repeating-linear-gradient(-45deg, rgba(255, 105, 180, .5), rgba(255, 105, 180, .5) 1px, transparent 1px, transparent 15px);
}

Example

Based on original code from Christopher Burton.