by Ange Tuteur April 25th 2015, 9:51 pm
I'm assuming you didn't read
this post, because there's no style for the dropdown.
This should go in place of your script :
(
Modules > JS codes management )
- Code:
$(function(){
var page = '/h1-', forums = '1|2|3|4';
$('.i_post').parent().each(function(){
if (RegExp('/post\\?f=('+forums+')&mode=newtopic').test($(this).attr('href'))) {
$(this).after('<div class="dropdown" style="display:none;"><p>Select a mode</p><a href="'+page+'">Advanced</a><a href="'+$(this).attr('href')+'">Simple</a></div>').click(function() {
var a = $(this).next();
a.css('display') == 'none' ? a.css('display','block') : a.css('display','none');
return false;
});
}
});
});
Explanation :
page : the link to your HTML page.
forums : the id of the forums you want this applied to. IDs should be separated by |
and you MUST add this CSS for the drop down :
(
Display > Colors > CSS stylesheet )
- Code:
.dropdown {
background:#EEE;
border:1px solid #CCC;
padding:3px;
position:absolute;
}
You can use the
.dropdown classname to select elements inside to drop down for styling. e.g. style the links to appear like buttons :
- Code:
.dropdown a {
color:#666;
text-align:center;
background:#CCC;
padding:3px;
border-radius:3px;
margin:2px 0;
display:block;
width:93% !important;
}