This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ovpr/ovpr.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
77 lines (53 sloc)
1.84 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
// Slideshow modifications | |
var slideshowHeight = $('.slider-wrapper').height(); | |
var capOffset = slideshowHeight * .42 | |
$('.nivo-caption').css('padding-top', capOffset+'px') | |
$('.nivo-caption').on('click', function(){ | |
var url= null | |
$('.uc-link-url').each(function(){ | |
var css = $(this).attr('style') | |
if (css.indexOf('block') > -1) { | |
var newUrl = $(this).attr('href') | |
window.location = newUrl | |
} | |
}) | |
}); | |
/* | |
$('.uc-link-url').each(function(){ | |
var url = $(this).attr('href') | |
var a = $('<span>') | |
a.attr('href', url) | |
a.append('Read More') | |
a.addClass('read-more') | |
$(this).prepend(a) | |
}) | |
/* | |
prepend('<span class="nivo-text">'); | |
$('#home1 .nivo-caption').append('</span>') | |
console.log($('#home1 .nivo-caption').html()) | |
*/ | |
//OVPR Top Home section with equal heights across elements. | |
function equalHeightHome(){ | |
//console.log('equalHeightHome()...'); | |
$('#sidebar-widgets .widget:last-child').css('margin-bottom','0px'); | |
var sideHeight = $('#home-aside').outerHeight(); | |
var slideHeight = $('#home1').outerHeight(); | |
//console.log('sideHeight:'+ sideHeight) | |
//console.log('slideHeight:'+ slideHeight) | |
if (sideHeight < slideHeight) { | |
//console.log('side is shorter'); | |
var diff = (slideHeight - sideHeight) -2; | |
//console.log('diff:'+diff); | |
$('#sidebar-widgets .widget:first-child').css('padding-bottom', diff); | |
}; | |
} | |
equalHeightHome(); | |
// Image Widgets - change titles to <a>'s that point to the "Link". | |
$('#home-main .widget_sp_image').each(function(index, element){ | |
var headerText = $(this).children('.widget-title:first').html(); | |
var imgLink = $(this).children('a:first').attr('href'); | |
var newHeader = '<a href="'+imgLink+'">'+headerText+'</a>'; | |
$(this).children('.widget-title:first').html(newHeader); | |
}); | |
}); |