Little error in "Thanks, Roy" theme

12 views
Skip to first unread message

Benoist Lawniczak

unread,
Mar 20, 2014, 7:28:40 AM3/20/14
to omek...@googlegroups.com
Hello,

I noticed that there is a little error in the "Thanks, Roy" theme.

When your window is some pixel more than 768, there's no menu displayed. This is due to a difference between css that use device width and javascript that use document width.

Here's my solution. In 'globals.js', add this function :

function viewport() {
var e = window, a = 'inner';
if (!('innerWidth' in window )) {
a = 'client';
e = document.documentElement || document.body;
}
return { width : e[ a+'Width' ] , height : e[ a+'Height' ] };
}

Then modify line 66 :

if ($(window).width() < 768) {

by this :

if (viewport().width < 768) { 

 


I join my modified 'globals.js'. Hope it helps :)
globals.js
Reply all
Reply to author
Forward
0 new messages