Skip to content

Instantly share code, notes, and snippets.

View vejnoe's full-sized avatar

Andreas Vejnø Andersen vejnoe

View GitHub Profile
_wrappers.so
<input type="hidden" id="from-url" name="From URL" value="JS not run 😬">
<script>
var Webflow = Webflow || [];
Webflow.push(function () {
$('#from-url').val(window.location.href);
});
</script>
@vejnoe
vejnoe / tabs-triggered-by-url-webflow.html
Last active October 30, 2020 08:23
Acticating the Tab with the same name as the #hash from the URL - Webflow
<script>
var Webflow = Webflow || [];
Webflow.push(function () {
// Getting the #hash from the URL
var url = window.location.hash;
// Removing the # symbel
var tab = url.substr(1);
// Acticating the tab with the same name as the #hash from the URL
$('.w-tab-menu > a[data-w-tab="' + tab + '"]').click();
});
@vejnoe
vejnoe / include-title-in-form.html
Last active October 30, 2020 07:09
Include title in form submission - Webflow
<script>
// Adding the title of the page to a hidden form element.
var Webflow = Webflow || [];
Webflow.push(function () {
$('#event').attr( 'value', $('title').html() );
});
</script>
<input type="hidden" id="event" name="event" value="Unknown">
@vejnoe
vejnoe / 301.php
Created September 30, 2020 07:07 — forked from CrowderSoup/301.php
Simple PHP Redirect
<?php
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://example.com');
?>
@vejnoe
vejnoe / webflow-snippet.html
Last active August 3, 2020 07:24 — forked from danro/webflow-snippet.js
Webflow.js front-end JS wrapper
<script>
var Webflow = Webflow || [];
Webflow.push(function () {
// DOMready has fired, may now use jQuery and Webflow api
});
</script>
@vejnoe
vejnoe / webflow-resize.js
Created March 26, 2020 09:16 — forked from danro/webflow-resize.js
Webflow.js resize example
var Webflow = Webflow || [];
Webflow.push(function () {
// Find example element
var $element = $('.resize-demo');
var $parent = $element.parent();
// Listen for optimized resize event
Webflow.resize.on(function () {
@vejnoe
vejnoe / jq-document-ready.js
Created January 8, 2020 10:47
jQuery wrapper
(function($){
$(document).ready(function() {
})
})(jQuery);
@vejnoe
vejnoe / webflow-breakpoints.css
Last active July 17, 2024 22:36
Webflow Standard Breakpoints
@media screen and (max-width: 991px) {
/* Your responsive CSS */
}
@media screen and (max-width: 767px) {
/* Your responsive CSS */
}
@media screen and (max-width: 479px) {
/* Your responsive CSS */
}
@vejnoe
vejnoe / template.php
Last active January 16, 2017 07:48
Making user mail available in user-profile.tpl.php via template.php – Drupal 7
<?php
/**
* Process variables for user-profile.tpl.php.
*
* The $variables array contains the following arguments:
* - $account
*
* @see user-profile.tpl.php
*/
function YOUR_THEMENAME_preprocess_user_profile(&$variables) {