Skip to content

Instantly share code, notes, and snippets.

@akv2
akv2 / function.php
Created December 2, 2020 21:32 — forked from tanmay27vats/function.php
Remove "Product Type/Product Data" Dropdown Options - WooCommerce
add_filter( 'product_type_selector', 'remove_product_types' );
function remove_product_types( $types ){
unset( $types['grouped'] );
unset( $types['external'] );
unset( $types['variable'] );
return $types;
}
@akv2
akv2 / maximage-offset-contained.js
Created October 12, 2012 18:31
The code used to make offsets with Maximage 2.0.
$(function(){
// Trigger maximage
jQuery('#maximage').maximage({
cssBackgroundSize: false, // We don't want to use background-size:cover for our custom size
backgroundSize: function( $item ){
var verticalOffset = 200, // Top offset + Bottom offset
horizontalOffset = 200; // Left offset + Right offset
if($.Window.data('w') / $.Window.data('h') < $item.data('ar')){ // Image size based on height
$item
@akv2
akv2 / maximage-html5video.js
Created August 9, 2012 20:04
The code used to make a single HTML5 video fullscreen.
$(function(){
// Helper function to Fill and Center the HTML5 Video
jQuery('video, object').maximage('maxcover');
});
@akv2
akv2 / maximage-custombackgroundsize.js
Created August 9, 2012 19:40
This code uses a custom function to resize the background image.
$(function(){
// Trigger maximage
jQuery('#maximage').maximage({
cssBackgroundSize: false,
backgroundSize: function( $item ){
// Contain portrait but cover landscape
if ($item.data('h') > $item.data('w')) {
if ($.Window.data('w') / $.Window.data('h') < $item.data('ar')) {
$item
.height(($.Window.data('w') / $item.data('ar')).toFixed(0))
@akv2
akv2 / maximage-fillelement.css
Created August 9, 2012 19:36
This code explains how easy it is to run maximage within a containing element.
/* Basic CSS for FillElement */
#holder {
height:300px;
overflow: hidden;
width:300px;
}
#maximage {
position:relative !important;
}
@akv2
akv2 / maximage-basic.html
Created August 9, 2012 19:19
The most basic example of how to trigger Maximage2.
<!-- Basic HTML -->
<div id="maximage">
<img src="../lib/images/demo/wall_portrait.jpg" alt="" width="1400" height="1050" />
<img src="../lib/images/demo/coalesse.jpg" alt="Coalesse" width="1400" height="1050" />
<img src="../lib/images/demo/laughing.jpg" alt="" width="1400" height="1050" />
<img src="../lib/images/demo/roof_shooting.jpg" alt="" width="2048" height="1536" />
<img src="../lib/images/demo/man.jpg" alt="" width="2048" height="1536" />
<img src="../lib/images/demo/coffee_shop.jpg" alt="" width="2048" height="1536" />
<img src="../lib/images/demo/gas_station.jpg" alt="" width="2048" height="1536" />
</div>
@akv2
akv2 / maximage-generic.js
Created August 9, 2012 18:08
Generic settings for maximage demo.
$(function(){
$('#maximage').maximage({
cycleOptions: {
fx: 'fade',
// Speed has to match the speed for CSS transitions
speed: 1000,
timeout: 0,
prev: '#arrow_left',
next: '#arrow_right',
pause: 1