Using a text only editor like NotePad, in the splitmenubuttons.js script, find this function:
Code:
function positionmenu(s, level, $toggler, $dropmenu){
if (level == "toplevel"){
var docrightedge = $(document).scrollLeft() + $(window).width() - 40
var docbottomedge = $(document).scrollTop()+$(window).height()-40
this.docrightedge = docrightedge // cache this value
this.docbottomedge = docbottomedge
var $offset = $toggler.data('mainanchor').offset()
var togglerWidth = (s.split)? $toggler.data('mainanchor').width() + $toggler.width() : $toggler.width()
var togglerHeight = $toggler.height()
var dropmenuWidth = $dropmenu.outerWidth()
var dropmenuHeight = $dropmenu.outerHeight()
var leftpos = (($offset.left + dropmenuWidth) > docrightedge)? $offset.left - (dropmenuWidth - togglerWidth) : $offset.left
var toppos = (($offset.top + dropmenuHeight) > docbottomedge)? $offset.top - (dropmenuHeight + togglerHeight) : $offset.top
return {left: leftpos, top: toppos}
}
else{
var $offset = $toggler.offset()
var submenuWidth = $dropmenu.outerWidth()
var submenuHeight = $dropmenu.outerHeight()
var leftpos = ($offset.left + (submenuWidth*2) > this.docrightedge)? -submenuWidth : submenuWidth
var toppos = ($offset.top + (submenuHeight) > this.docbottomedge)? -submenuHeight + $toggler.height() : 0
return {left: leftpos, top: toppos}
}
}
Change the highlighted line to:
Code:
var docbottomedge = 99999999
Save and use that version of the script.
The browser cache may need to be cleared and/or the page refreshed to see changes.
I'm not sure what you mean about the z-index. If you mean that you want the menu to drop over the iframe border, z-index will not do that. There is a fellow on here who has code for that sort of thing though, hopefully he will reply.
But my approach would be, instead of an iframe, I would use either a server side include (if available) or AJAX.
If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
Bookmarks