MyBB Community Forums

Full Version: Can't get a jquery to show up in fixed header?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have a fixed header with a network tab created using jquery and work just fine having it inside of the "Header" template.

I am trying to make a login form on the other side of the network tab (on the fixed header bar though) and copied my setting from my network tab jquery and it won't show up. I created it inside of header_welcomeblock_guest but I included it inside the (Fixed_Header) div so that it will place it into the fixed header. It won't show up.

HeaderInclude:
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1600"></script>


<script type="text/javascript">
if (typeof jQuery == 'undefined') {
    document.write(unescape("%3Cscript src='http://code.jquery.com/jquery-1.7.2.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>


<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery(".network").click(function() { jQuery('.network-slide').slideToggle('fast'); }); });
</script>


<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery(".login").click(function() { jQuery('.login-slide').slideToggle('fast'); }); });
</script>


{$stylesheets}
<script type="text/javascript">


<!--
	var cookieDomain = "{$mybb->settings['cookiedomain']}";
	var cookiePath = "{$mybb->settings['cookiepath']}";
	var cookiePrefix = "{$mybb->settings['cookieprefix']}";
	var deleteevent_confirm = "{$lang->deleteevent_confirm}";
	var removeattach_confirm = "{$lang->removeattach_confirm}";
	var loading_text = '{$lang->ajax_loading}';
	var saving_changes = '{$lang->saving_changes}';
	var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
	var my_post_key = "{$mybb->post_code}";
	var imagepath = "{$theme['imgdir']}";
// -->
</script>
{$newpmmsg}

header_welcomeblock_guest:
<script type="text/javascript">
<!--
	lang.username = "{$login_username}";
	lang.password = "{$lang->login_password}";
	lang.login = "{$lang->login}";
	lang.lost_password = " &mdash; <a href=\"{$mybb->settings['bburl']}/member.php?action=lostpw\">{$lang->lost_password}<\/a>";
	lang.register_url = " &mdash; <a href=\"{$mybb->settings['bburl']}/member.php?action=register\">{$lang->welcome_register}<\/a>";
	lang.remember_me = "{$lang->remember_me}";
// -->
</script>

<div id="fixed_header">
        <div class="login">
                <div class="login-slide" style="display: none;">
                        <h3>VisualizeEdits</h3>
                        <ul>
                                <li><img src="images/VEPlus_Green.png" valign="middle" height="19" width="43"><a href="#">Central</a></li>
                                <li><img src="images/VEPlus_Cyan.png" valign="middle" height="19" width="43"><a href="#">Gaming</a></li>
                                <li><img src="images/VEPlus_Orange.png" valign="middle" height="19" width="43"><a href="#">Coding</a></li>
                                <li><img src="images/VEPlus_Pink.png" valign="middle" height="19" width="43"><a href="#">Dev</a></li>
                                <li><img src="images/VEPlus_Purple.png" valign="middle" height="19" width="43"><a href="#">Graphics</a></li>
                                <li><img src="images/VEPlus_Yellow.png" valign="middle" height="19" width="43"><a href="#">Editing</a></li>
                                <li><img src="images/VEPlus_Red.png" valign="middle" height="19" width="43"><a href="#">Support</a></li>
                        </ul>
                </div>
        </div>
</div>

CSS: (Copied from the network tab and move the margin to right.)
.login {
        background:url(images/VE_active.png);
        width: 130px;
        height: 30px;
        margin-right: 90px;
        margin-top: 3px;
}

.login:hover {
        background:url(images/VE_hover.png);
        width: 130px;
        height: 30px;
        border-radius: 4px;
}

.login-slide {
        background:url(images/backgrounds/background.png);
        position: absolute;
        float: left;
        border: 1px solid #000;
        z-index: 9999;
        width: 150px;
        border-bottom-left-radius: 6px;
        border-bottom-right-radius: 6px;
        margin-top: 32px;
        margin-left: -13px;
}

.login-slide h3 {
        background:url(images/backgrounds/top_header.png);
        padding-top: 5px;
        padding-bottom: 5px;
        margin-top: 0;
        border-bottom: 1px solid #000;
}

.network-slide ul {
        list-style: none;
        margin-top: -15px;
        margin-left: -40px;
        margin-bottom: 0;
}

.login-slide li {
        padding-top: 8px;
        padding-bottom: 8px;
        background:url(images/backgrounds/background.png);
        font-weight: bold;
        padding-left: 8px;
        text-align: left;
        padding-top: 3px;
        padding-bottom: 3px;
}

.login-slide li:hover {
        background:url(images/backgrounds/top_header.png);
        font-weight: bold;
}

.login-slide a {
        font-weight: bold;
        color: #000;
        font-size: 15px;
        padding-left: 5px;
}

.login-slide a:hover {
        text-decoration: none;
}

.login-slide img {
        margin-top: -7px;
}

If you want to see it in an image version.
HeaderInclude: http://gyazo.com/cbbb90e882585b717df0454888ec65e0
Header_Welcomeblock_Guest: http://gyazo.com/2410d5e55d28fa101a268052832bccd4
CSS: http://gyazo.com/9082f87036e2154d6f398162ca5bd0cd

Website: http://www.ComingSoon.VisualizeEdits.com/
helo bro.

whether you want to create a login form in the header?

http://gyazo.com/984cdcd056126990f8c576f3ce67c5e8
(2013-07-22, 06:33 AM)ikhwanulfikri Wrote: [ -> ]helo bro.

whether you want to create a login form in the header?

http://gyazo.com/984cdcd056126990f8c576f3ce67c5e8

Yeah, I duplicated my jquery for the network dropdown menu and renamed it with "login" in it but I don't see it anywhere on my page. Trying to move that duplicated jquery here.

http://gyazo.com/757a72b24fbb27da8486b408ec0418ff

I was going to move it here and then fix it up to make it a login box but I have no idea why the duplicated jquery isn't working. Does the code above help at all or no?
hello bro.

I look at css
.login-slide {
float: left;
}

Do you want to put it right: float: right;
(2013-07-22, 07:16 AM)ikhwanulfikri Wrote: [ -> ]hello bro.

I look at css
.login-slide {
float: left;
}

Do you want to put it right: float: right;

Thanks I made it right but I don't think the jquery is even working because it's not showing up anywhere on the page. Will have to look at the code again. I think it's because I placed it inside the "Fixed_Header" divs but I don't know. The Fixed_Header divs is originally in the "Header" template and I placed the jquery in the header_welcomeblock_guest.
Are you sure you saved the new login html code on the same template as the network-slide code?

When I view the page source, this piece of html code is not even showing.
<div class="login-slide" style="display: none;">

So I think the html for the login part is not being saved or saved incorrectly.

Should be like this right?
<div class="network">
   <div class="network-slide" style="display: none;">
     ...
   </div>
</div>

<div class="login">
   <div class="login-slide" style="display: none;">
     ...
   </div>
</div>
sorry bro. I can not solve this problem.

My head is or is very sick now. maybe you can pm other friends.
(2013-07-22, 07:50 AM)ronangelo Wrote: [ -> ]Are you sure you saved the new login html code on the same template as the network-slide code?

When I view the page source, this piece of html code is not even showing.
<div class="login-slide" style="display: none;">

So I think the html for the login part is not being saved or saved incorrectly.

Should be like this right?
<div class="network">
   <div style="display: none;" class="network-slide">
     ...
   </div>
</div>

<div class="login">
   <div class="login-slide" style="display: none;">
     ...
   </div>
</div>

I know, that why I was very curious because I look inside my html in the "Inspect Element" to find out why I don't see my login but I don't even see the html.

It's saved as you can see here:
http://gyazo.com/7dd33b30178a222a436919f0e7265843

(2013-07-22, 07:52 AM)ikhwanulfikri Wrote: [ -> ]sorry bro. I can not solve this problem.

My head is or is very sick now. maybe you can pm other friends.

It's fine. I appreciate you trying though. I have a back-up plan and can just make it inside the "Fixed Header" in the header template but it is going to need to change after users log in which is why I need it to be in the header_welcomeblock_guest so that it can be changed after users log in.

I think something is missing that's suppose to be inside that template in order for it to be shown in the html.
(2013-07-22, 07:54 AM)VisualizeEdits Wrote: [ -> ]It's saved as you can see here:
http://gyazo.com/7dd33b30178a222a436919f0e7265843

But looking at that screenshot, the network slide is missing. If both your slide should appear on the fixed_header then shouldn't they be together?

Probably like this
<div id="fixed_header">
   <div class="network">
      <div style="display: none;" class="network-slide">
        ...
      </div>
   </div>

   <div class="login">
      <div class="login-slide" style="display: none;">
        ...
      </div>
   </div>
</div>
(2013-07-22, 08:03 AM)ronangelo Wrote: [ -> ]
(2013-07-22, 07:54 AM)VisualizeEdits Wrote: [ -> ]It's saved as you can see here:
http://gyazo.com/7dd33b30178a222a436919f0e7265843

But looking at that screenshot, the network slide is missing. If both your slide should appear on the fixed_header then shouldn't they be together?

Probably like this
<div id="fixed_header">
   <div class="network">
      <div style="display: none;" class="network-slide">
        ...
      </div>
   </div>

   <div class="login">
      <div class="login-slide" style="display: none;">
        ...
      </div>
   </div>
</div>

My network slide is in my header template as well as my fixed header. I'm trying to get my login slide to show up in the fixed header as well but in a different template.
Pages: 1 2