Skip to content

Instantly share code, notes, and snippets.

@technosailor
Created May 4, 2012 18:02
Show Gist options
  • Save technosailor/2596610 to your computer and use it in GitHub Desktop.
Save technosailor/2596610 to your computer and use it in GitHub Desktop.
<?php
class Fun_Stuff {
function __construct()
{
$this->hooks();
}
function hooks()
{
add_action( 'wp_head', array( $this, 'css' ) );
add_action( 'wp_head', array( $this, 'js' ) );
}
function js()
{
wp_enqueue_script( 'jquery' );
wp_print_scripts();
?>
<script>
jQuery(document).ready(function() {
jQuery('.entry-content img').hover(
function(){
jQuery(this).addClass('largerthanlife');
},
function(){
jQuery(this).removeClass('largerthanlife');
});
});
</script>
<?php
}
function css()
{
?>
<style>
.largerthanlife { width: 500px; height: 300px; }
</style>
<?php
}
}
$whattawhat = new Fun_Stuff;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment