I set up a single page layout so I'm using anchor tags as part of my site navigation. All of them are working except the portfolio tag. When I select portfolio from my menu, the screen jumps down to the proper section and then immediately moves to the section above.
I'm not sure if there is some interference from any of my other code, or if the animation of the "solutions" pictures/text is creating the issue but I can't seem to solve it on my own.
Something to note is that the link does work, but only when you already have portfolio selected (ex. /#portfolio)
My site is http://muvltd.com
Any idea?
There is no problem with your anchors. The problem is that the orange circles in the solutions section are not displayed until you scroll down, so they are not yet rendered into the page. This gives the portfolio section a higher absolute position in your page. Chrome jumps to your section which first works fine. But when the solutions section is loaded it pushes down the portfolio.
If you know the exact height of the solutions section or the images contained in the section, I suggest you assign this height to the respective elements. This way, all dimensions are set correctly before the content is actually loaded / initialized.
I found a solution, in my original code, the anchor tag was outside of the paragraph tags:
<p style="text-align: center;padding-top: 55px;">[maxbutton id="5"]</p><a id="portfolio"></a>
Putting them inside the tags solved the problem:
<p style="text-align: center;padding-top: 55px;">[maxbutton id="5"]<br><a id="portfolio"></a></p>
I can't tell you why it would make a difference but it did, thanks for the help!
Related
So I apologize in advance if this question has been answered before- I tried searching but couldn't find much on it.
A designer and I are working to create this website- www.zeinal-jundi.com
This is predominantly a one-page layout using a scroll effect to navigate to different sections, although the site's Discography section does link to a separate page for each album. We also have a fixed header that allows the navigation to be visible the whole time. Originally, I had added a margin to each section of the page to accommodate the height of the fixed header. This however made the space between each section far too large, so my designer requested I find a way around this. I was able to fix it by instead adding a value to the scroll animation script that brings the section around 250px from the top, rather than to the overall top of the page (where it would then be covered by the fixed header)
So now, I've of course encountered the issue of linking to these sections from off another page- using code like the following:
Biography
This of course links back to the front page, but brings the section up to the very top, where it is hidden by our header. I'm wondering if anyone knows of a way I can link to this section from another page but add an action similar to the one I have on the scrolling function that will bring it up to 250px down from the top of the page rather than the very top without me having to add margins to each div.
Another option of course it to just make that pesky fixed header a lot shorter, or possibly hide the site title after the page scrolls to a certain point, but our client seems pretty adamant about having the entire header visible throughout, so I of course am trying to find a work around so we won't have to rethink the entire element (if such a solution even exists).
I hope I explained this well enough! Let me know if you need to see any additional code- would love to hear your thoughts on how to achieve such a thing! :)
If you're placing the block through CSS, you can use the CSS3 :target pseudo selector to position whatever section the link pointed to, e.g.:
:target {
/* ... example:
top: 250px;
*/
}
I'm having an issue where when I scroll through my homepage with the anchor tag sections it does not line up properly. For instance, if I click "showcase" it will go to the section but not highlight the navigation hover like it should. However, if I scroll slightly down it will then hover.
I read online in the past this was resolved by adding padding into the css for the section tag. I couldn't seem to get it to work.
Any help is appreciated, thank you.
BQ: How do I change the active section the page opens to? I tried changing the "active" tag, but it still uses the same section.
I'm using this template: http://www.blacktie.co/demo/pratt/#home
you have two identical ID's on your page , eg #showcase. Other then that you probably need to set an offset in the jquery scrollto function.
I'm experiencing an extremely weird behavior when using Twitter Bootstrap's affix plugin, fixed navbar, and anchor links together. I'm going to attempt to explain my problem but it's kind of difficult to put into words, so please forgive me if I'm not the clearest.
I have a navbar-fixed-top at the top of my page. Under that I have a .container div. Inside there I have two div.spans (span4 and span8). Inside span4 is a div.well that has the affix-top class applied to it (so it gets a fixed position and "sticks" where it's at). Inside my span8 I have a bunch of content.
Inside the well div there is a nav-list. This list gets populated with li/a elements based on items in the span8 (I have a little script that does this). The links are anchors, so they point to elements on the page (#myId, #myIdTwo, etc). All this works wonderfully. My list is there, the links are clickable, they take me to my elements. Great.
However, not great. Sometimes, when I click one of the links, I go to my anchor in the span8 but the page doesn't seem to refresh properly. I sometimes see strange white "boxes". Or the content inside the span will show partly above the fixed nav-header. Sometimes half of the nav-list disappears.. but then comes back (sort-of) if I move my mouse around it. Like you used to see in some old Windows applications that were getting bogged down.
You can see for yourself here: http://jaylach.github.com/lutra. You may need to click some of the nav links a few times before you see the issue.
I've been struggling with this all day and I cannot, for the life of me, figure it out. I've taken out the affixes, I've taken out the fixed top navbar, I've taken out my z-index. I just can't seem to figure it out.
Does anyone, anywhere, have any clue as to what could be causing this? I would really appreciate any advice you guys could give.
Many thanks in advance!!
This is a WebKit bug.
add -webkit-transform: scale3d(1,1,1); to both .navbar-fixed-top and .affix
both styles are defined in bootstrap.min.css. So override these 2 styles in your main.css as:
.affix,.navbar-fixed-top {
-webkit-transform: scale3d(1,1,1);
}
I have a fixed menu bar at the top of my site. I have a page that has inline linking by adding a hash tag to the URL making it jump to that particular element. The problem is the element it jumps to is hidden being this fixed menu bar. Is there a way to move the jump down a bit? Here is an example:
Example
Sadly you cannot do that via html, you'd need some JS, or even CSS, depending on your code.
Can you post a sample on jsfiddle.net ?
As a workaround, add another (hidden) element below it and simply link to that one instead:
click me
<!-- further down the page is the content -->
<div id="#element1">Here is what users will be reading!</div>
<div id="#element1-target"
style="visibility:hidden;{make this lower down below the actual text}"></div>
My only question though, is if your header bar is blocking your text that the page 'jumps' to, wouldn't you want the page to link to higher than the target?
Given your question is vague and I don't think your example shows what your problem is, this should do what (i think) you're trying to do.
:)
I am trying to fit a normal web player into a wordpress post. My site is self hosted. The problem is with the positioning of a DIV (not really an issue with wordpress).
Here is the page that I am working on:
http://grayradio.com/mishkin-hits/
The music player was supposed to come at the post area but it is going all the way down below the footer.
I am inserting all the necessary code within the post's main container but for some reason the div class 'ttw-music-player' goes out of this container div.
I tested by putting a paragraph text inside the post's main container at the same time keeping the div class 'ttw-music-player'. The paragraph text appeared properly but the player div went out.
I have access to change my code and that of the player's but I am not sure where to start. Please help. Thank you.
I was using 'body' tag to position the player in one of the JS files. When i changed it to a specific DIV, it worked. Not sure if it is a wordpress specific thing!!