The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How do I do that when you press the button Add a new topic..؟

4 posters

Page 2 of 2 Previous  1, 2

Go down

In progress How do I do that when you press the button Add a new topic..؟

Post by hamesashek April 21st 2015, 5:10 pm

First topic message reminder :

How do I do that when you press the button Add a new topic
To look like this
Example 

How do I do that when you press the button Add a new topic..؟ - Page 2 2015-012
https://i.servimg.com/u/f19/19/20/32/92/2015-012.png
hamesashek
hamesashek
Forumember

Male Posts : 111
Reputation : 1
Language : hamesashek

http://bestk.forumegypt.net

Back to top Go down


In progress Re: How do I do that when you press the button Add a new topic..؟

Post 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;
}
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Page 2 of 2 Previous  1, 2

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum