You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code opening and closing the slide-menu is as follows:
(function($) {
$.fn.slideMenu = function(div) {
return this.eq(0).each(function() {
var $a = $(this);
var $span = $a.parent();
var $menu = $(div);
var menuId = $a.attr('href');
if ($.fn.slideMenu.openMenu && $.fn.slideMenu.openMenu == menuId) {
$.fn.slideMenu.openMenu = false;
$menu.hide();
} else {
// right align the menu?
var alignRight = $span.hasClass('right');
// display and hide menu? maybe calculation of width will not work if closed?
var spanPos = $span.offset();
var spanWidth = $span.outerWidth();
var spanHeight = $span.outerHeight();
var pagePos = $('#page').offset();
var menuWidth = $menu.outerWidth();
var duration = Math.max($menu.outerHeight()*1.5, 250);
if (alignRight) {
$menu.css('left', spanPos.left - pagePos.left - menuWidth + spanWidth).css('top', spanPos.top - pagePos.top + spanHeight);
} else {
$menu.css('left', spanPos.left - pagePos.left).css('top', spanPos.top - pagePos.top + spanHeight);
}
$menu.slideDown(duration);
$.fn.slideMenu.openMenu = menuId;
}
});
};
})(jQuery);
The code used to attach the slideMenu contents to the a-tags:
function prepareMenus() {
var openMenu = false;
var $menus = $('div.menus');
$('#page').append($menus);
$('span.menu a').click(function() {
var $a = $(this);
var href = $a.attr('href');
var pos = href.indexOf('#');
var id = href.substr(pos);
var $div = $(id, $menus);
The code used to prepare the rounded corners:
function prepareCorners() {
$('div.content span.edit a').corner("4px").parent().corner("5px");
if (!$.browser.msie) { $menus = $('div.content div.menus');
$('div.items', $menus).corner("5px").parent().corner("7px");
}
}
In summary:
All span.edit a elements get rounded corners
All a.menu elements get an attached slideDown menu
The slideDown functionality is handled in the slideDown extension
As you can see the rounded corners of the menu itself (not the buttons within) are already excluded as they lead to a menu that looks very similar to the ie8-screenshot (but the whole menu displays in such a way).
The text was updated successfully, but these errors were encountered:
We use jquery.corner to do rounded corners in our application.
Mostly this works fine. But in some situations (above all in combination with li elements) it produces extremly strange results.
display in firefox: http://dl.dropbox.com/u/1776128/firefox3.6-windows.png
display in ie8: http://dl.dropbox.com/u/1776128/ie8.png
The file code can be seen in
http://dl.dropbox.com/u/1776128/%40menus.html
The code opening and closing the slide-menu is as follows:
(function($) {
$.fn.slideMenu = function(div) {$a = $ (this);$menu = $ (div);
return this.eq(0).each(function() {
var
var $span = $a.parent();
var
var menuId = $a.attr('href');
};
})(jQuery);
The code used to attach the slideMenu contents to the a-tags:$menus = $ ('div.menus');$a = $ (this);$div = $ (id, $menus);
function prepareMenus() {
var openMenu = false;
var
$('#page').append($menus);
$('span.menu a').click(function() {
var
var href = $a.attr('href');
var pos = href.indexOf('#');
var id = href.substr(pos);
var
}
The code used to prepare the rounded corners:
$menus = $ ('div.content div.menus');
function prepareCorners() {
$('div.content span.edit a').corner("4px").parent().corner("5px");
if (!$.browser.msie) {
$('div.items', $menus).corner("5px").parent().corner("7px");
}
}
In summary:
As you can see the rounded corners of the menu itself (not the buttons within) are already excluded as they lead to a menu that looks very similar to the ie8-screenshot (but the whole menu displays in such a way).
The text was updated successfully, but these errors were encountered: