Skip to content

Instantly share code, notes, and snippets.

View Webbist-dev's full-sized avatar

Alex Bennett Webbist-dev

View GitHub Profile
// Add functionality for Ingredients "Card Flip"
//
$('.product-img-box-pdp').wrapInner('<div class="product-img-box-pdp-inner-wrap" style="display: none;" />');
$(".ingredients-text").wrapInner('<div class="ingredients-text-inner-wrap"" />');
$('.product-img-box-pdp').prepend('<div class="product-img-box-pdp-inner" style="width: 100%;" />');
$('.product-img-box-pdp-inner').css('min-height', productImgHeight);
$('.product-img-box-pdp figure').clone().appendTo('.product-img-box-pdp-inner').show();
$('.ingredients-button-close').click(function() {
$(".ingredients-link").removeClass('ingredient-active');
$(".product-img-box-pdp-inner").flippy({
<iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FNelson-Primary-School%2F174534929241708%3Ffref%3Dts&amp;width=50&amp;height=62&amp;colorscheme=light&amp;show_faces=false&amp;header=false&amp;stream=false&amp;show_border=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:62px;" allowTransparency="true"></iframe>
@Webbist-dev
Webbist-dev / Script
Created October 2, 2014 08:49
Script to find active link from page url
$('.sibling-pages li a').each(function() {
var url = window.location.href; $(this).filter(function() {
return this.href == url; }).addClass('current');
});
@Webbist-dev
Webbist-dev / gist:0b0f2472c90ccfe624a2
Created November 19, 2014 14:16
First php class and object usage
class Person {
public $teacher;
public $student;
public $age;
function displayStudentNameandTeacher() {
echo 'My Name is ' . $this->student . ' my teacher is ' . $this->teacher . '. My teachers age is ' . $this->getAge() . '.';
}
function setAge($var) {
$this->age = $var;
@Webbist-dev
Webbist-dev / footer.phtml
Created November 27, 2014 15:16
Moving blocks around in magento
@Webbist-dev
Webbist-dev / gulpfile.js
Created December 12, 2014 10:00
Gulpfile
process.env.NODE_ENV = 'development';
var gulp = require('gulp'),
sass = require('gulp-sass'),
compass = require('gulp-compass'),
minifycss = require('gulp-minify-css'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps'),
@Webbist-dev
Webbist-dev / _rem.scss
Created December 12, 2014 10:08
convert pixel to rem
@function rem($pxval) {
$val: strip-unit($pxval);
$base: strip-unit($browser-default-font-size);
@if ($old-ie == true) {
@return $val * 1px;
}
@else {
var App = {
myProperty : 'someValue',
jqueryVar1 : $('.someClass'),
jqueryVar2 : $('.someOtherClass'),
jqueryVar3 : $('#id'),
myConfig:{
useCaching:true,
language: 'en'
},
@Webbist-dev
Webbist-dev / contact.js
Created December 16, 2014 12:44
VSI contact form select changer
(function ($) { // passing Jquery $ into the function
// Define variable for our overall function
var Contact = {
// Define variables for the below function
contactItems: $('#block-views-studios-block .views-row'), // gets the container for each sidebar idem
selectDropdown: $( "#edit-submitted-studio"), // gets us the select element
// Initialising functions (Function written below)
init: function(){
this.contactItemChanger();
@Webbist-dev
Webbist-dev / left-right.js
Last active August 29, 2015 14:11
Calculate containers and apply left or right based on offset
(function ($) { // passing Jquery $ into the function
// Define variable for our overall function
var Timeline = {
// Define variables for the below function
timelineWrapper: $('.timeline'),
timelineItems: $('.timeline-wrapper'),
// Initialising functions (Function written below)
init: function(){
this.timelineAlignment();
},