- This topic has 17 replies, 3 voices, and was last updated 4 years, 7 months ago by David.
-
AuthorPosts
-
September 1, 2019 at 1:03 am #998235An Nguyen
Hi Tom, David and Leo,
I need your help!
Can I add a button “New” with animation affect like this GP site?
I try to add css class “menu-badge badge-bounce” in menu and add css code like this below but it not work
CSS:
.badge-bounce { animation: bouncing .8s cubic-bezier(0.1,0.05,0.05,1) 0s infinite alternate both; } .menu-badge { font-size: 9px; margin-left: 4px; position: relative; top: -10px; margin-bottom: 13px; color: #FF0000; background-color: #fff; padding: 3px 4px; border-radius: 3px; }
Thanks all,
Have a nice day!September 1, 2019 at 6:24 am #998378DavidStaffCustomer SupportHi there,
the original topic for adding that to the site can be found here:
https://generatepress.com/forums/topic/how-to-enable-these-in-menu/
September 1, 2019 at 9:50 am #998556An NguyenThanks David,
It works perfect.
I got some issues related to main navigation.
1/ Can you help me to disable slideout-toogle (cavas-off) on home page & page id-1630 and increase the width of cavas-off around 50px ?
I tried with this css below to disable it but the code did not work. It’s still there.
.home .slideout-toggle, .page-id-1630 .slideout-toggle { display: none; }
2/ I saw an error of size format of box search on sticky menu when I tried to click on search icon and my CSS size-format for search box is change, but in main-menu at top, it displays correct size.
-I also want to add contents inside placeholder like “Type info and search here…”.
I used Tom’s CSS code
.navigation-search.nav-search-active { left: auto; width: 355px; top: 100%; padding: 10px; background: #fff; border: 1px solid #ddd; } .navigation-search.nav-search-active input { border-radius: 5px; height: 10px; } .navigation-search { top: 150%; transition: opacity 300ms ease-in-out, top 300ms ease-in-out; left: auto; } .navigation-search.nav-search-active .search-button { position: absolute; right: 10px; top: calc(50% - 15px); height: 30px; display: block; content: "\f002"; font-family: GeneratePress; opacity: .5; width: auto; background: transparent; color: #000 !important; border: 0; padding: 3px 5px 5px 5px; }
September 1, 2019 at 5:00 pm #998731TomLead DeveloperLead DeveloperHi there,
1. Can you try this instead?:
body.home .main-navigation .slideout-toggle, body.page-id-1630 .main-navigation .slideout-toggle { display: none; }
Then, to increase the width, try this:
.main-navigation.offside { width: 300px; } .offside--right.is-open { -webkit-transform: translate3d(-300px,0,0); -moz-transform: translate3d(-300px,0,0); -ms-transform: translate3d(-300px,0,0); -o-transform: translate3d(-300px,0,0); transform: translate3d(-300px,0,0); } .offside--right { right: -300px; } .offside-js--is-right.slide-opened .slideout-overlay button.slideout-exit { right: 300px; }
2. Give this a shot:
.main-navigation.sticky-navigation-transition .navigation-search input[type="search"] { height: 10px; } .main-navigation.sticky-navigation-transition .navigation-search input[type="submit"] { height: auto; }
3. For the placeholder, we need to filter the html. It looks like we already are to add the button, so can you share the filter you’re currently using so we can adjust it?
September 1, 2019 at 5:22 pm #998737An NguyenHi Tom,
1/ code is good. It hides now. The size also increases 50px however, the right-padding is big. It needs to change.
2/ The display error is fixed.
3/I used your code in github:
add_filter( 'generate_navigation_search_output', function() { printf( '<form method="get" class="search-form navigation-search" action="%1$s"> <input type="search" class="search-field" value="%2$s" name="s" title="%3$s" /> <input type="submit" class="search-button" value=""> </form>', esc_url( home_url( '/' ) ), esc_attr( get_search_query() ), esc_attr_x( 'Search', 'label', 'generatepress' ) ); } );
September 1, 2019 at 5:27 pm #998741TomLead DeveloperLead Developer1. I’m not seeing any padding change – where should I be looking?
3. In that code, replace this:
<input type="search" class="search-field" value="%2$s" name="s" title="%3$s" />
With this:
<input placeholder="Type info and search here.." type="search" class="search-field" value="%2$s" name="s" title="%3$s" />
September 1, 2019 at 5:40 pm #998747An NguyenHi Tom,
1/I mean the content and the box search inside cavas-off (when slide-toggle is opened) need to increase the right-padding, because now, they are still the same size. You can see that there are around 50px from the right.
3/Code works perfect, Tom!
September 2, 2019 at 8:26 am #999226TomLead DeveloperLead DeveloperThe only thing that isn’t full width is the search bar. Try adding this:
.slideout-navigation .search-form input { width: 100%; }
September 2, 2019 at 8:33 am #999232An NguyenThanks Tom, now it looks good.
September 2, 2019 at 8:44 am #999243TomLead DeveloperLead DeveloperYou’re welcome ๐
September 2, 2019 at 9:06 am #999260An NguyenHi Tom,
It still has 1 small issue from mobile site when I tried to click on search button. The text displays in placeholder is just 1/2 in horizontal, but in desktop mode, it displays perfectly.
Thanks Tom.
September 2, 2019 at 3:07 pm #999497TomLead DeveloperLead DeveloperWhat browser is this happening in? Does this help?: https://generatepress.com/forums/topic/safari-iphone-search-positioning-bug/#post-870262
September 2, 2019 at 5:08 pm #999543An NguyenHi Tom,
It’s fixed.
Thanks Tom!
September 3, 2019 at 8:04 am #1000098TomLead DeveloperLead DeveloperYou’re welcome ๐
September 21, 2019 at 12:45 pm #1015462An NguyenHi Tom,
I have an issue on search function. When I click on search icon, the search panel moves down over the the header.
I turned off all plugins and autoptimze. Could you help me for that? -
AuthorPosts
- You must be logged in to reply to this topic.