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 to make a search Image actually work

3 posters

Go down

Solved How to make a search Image actually work

Post by Zed is Not Dead October 5th 2015, 4:03 am

I want to make this image right here

How to make a search Image actually work  UY1aH5I

Actually work like a search bar, I know it requires coding, mind helping me out?
Zed is Not Dead
Zed is Not Dead
Forumember

Posts : 257
Reputation : 28
Language : English

http://naruto-ld.forumotion.com/

Back to top Go down

Solved Re: How to make a search Image actually work

Post by Beyonder October 5th 2015, 5:55 am

Beyonder
Beyonder
Forumember

Male Posts : 721
Reputation : 29
Language : English
Location : Beyond Realm

http://fictionalomniverse.forumotion.com/

Back to top Go down

Solved Re: How to make a search Image actually work

Post by Ange Tuteur October 5th 2015, 10:52 am

Hi @Zed is Not Dead,

That should be pretty easy, just need the magnifying glass and search image. Where would you want it inserted, though ?
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to make a search Image actually work

Post by Zed is Not Dead October 5th 2015, 11:23 am

on the nav bar the overall nav bar will look like this

How to make a search Image actually work  PAhiVpu
Zed is Not Dead
Zed is Not Dead
Forumember

Posts : 257
Reputation : 28
Language : English

http://naruto-ld.forumotion.com/

Back to top Go down

Solved Re: How to make a search Image actually work

Post by Ange Tuteur October 5th 2015, 12:20 pm

Oh I see, add the following CSS to your stylesheet :
Code:
#navbar-search {
  position:relative;
  display:inline-block;
  opacity:1;
}
#nav-search-box, #nav-search-button { position:absolute }
#nav-search-form { display:inline }


#nav-search-box {
  color:#FFF;
  background:transparent;
  border:1px solid transparent;
  border-radius:9px;
  top:17px;
  left:14px;
  width:172px;
  height:20px;
  padding:3px;
}

#nav-search-button {
  background:transparent;
  border:1px solid transparent;
  width:100px;
  height:40px;
  top:12px;
  right:16px;
}


Then go to Modules > JavaScript codes management and create a new script with the following settings.

Placement : In all the pages
Code:
$(function() {
  var search = document.getElementById('i_icon_mini_search'), form;

  if (search) {
    form = document.createElement('FORM');
    search = search.parentNode;
    search.id = 'navbar-search';
    search.onclick = function(e) { e.preventDefault() };

    form.method = 'get';
    form.action = '/search';
    form.id = 'nav-search-form';
    form.innerHTML = '<input id="nav-search-box" type="text" name="search_keywords"/><input id="nav-search-button" type="submit" value="" onclick="this.parentNode.submit();"/>';

    search.appendChild(form);
  }
});

It should add a transparent input and button over the navbar image.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to make a search Image actually work

Post by Zed is Not Dead October 5th 2015, 8:38 pm

thanks! this is solved
Zed is Not Dead
Zed is Not Dead
Forumember

Posts : 257
Reputation : 28
Language : English

http://naruto-ld.forumotion.com/

Back to top Go down

Solved Re: How to make a search Image actually work

Post by Ange Tuteur October 5th 2015, 9:48 pm

You're welcome ^^

Topic archived

Have a great day. Smile
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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