1
0
mirror of https://gitlab.com/openlp/website.git synced 2024-12-23 05:22:53 +00:00
website/themes/openlp2v2/assets/js/custom.js

37 lines
1.3 KiB
JavaScript
Raw Normal View History

2015-07-11 21:57:10 +00:00
/* Theme Name: Worthy - Free Powerful Theme by HtmlCoder
* Author:HtmlCoder
* Author URI:http://www.htmlcoder.me
* Version:1.0.0
* Created:November 2014
* License: Creative Commons Attribution 3.0 License (https://creativecommons.org/licenses/by/3.0/)
* File Description: Place here your custom scripts
*/
$(function(){
$("div.product-chooser").find("div.product-chooser-item").on("click", function() {
var $this = $(this);
$this.parent().parent().find('div.product-chooser-item').removeClass('selected');
$this.addClass('selected');
var target = $this.attr("data-target");
$("#download-section > div > div").hide().removeClass("hidden");
$("#download-section > div > div." + target).show();
});
$(".scrollToTop a").on('click', function(e) {
e.preventDefault();
$('html, body').animate({scrollTop: 0}, 300);
});
var queryParams = location.search.slice(1).split("&");
var params = {};
queryParams.forEach(function (value) {
var parts = value.split("=");
params[parts[0]] = parts[1];
});
if (params.hasOwnProperty("m")) {
if (params.m == 1) {
$("#success-alert").removeClass("hidden");
}
else if (params.m == 0) {
$("#error-alert").removeClass("hidden");
}
}
});