Posted
·
Edited by Bugsy6912 Clarified some terminology
The site is amazing, and I can't thank all of you who made it enough. I'm going to try to do my little bit here and post how to make a change I think would improve the site, although I'm sure my explanation will be unnecessary thanks to our phenomenal programmers.
If you go to an event page on the site, such as https://wob.coppermind.net/events/127-salt-lake-city-comiccon-2017/, you'll notice that as you scroll down, the navbar at the top of the page attaches to the top and continues coming down for ease of access. I think this is a phenomenal feature (and I know a lot more work goes into something like this than it seems on the surface), so when someone else mentioned that the event box on the side should do the same, I agreed. I then played around in Inspect Element until I figured out how to make that work, hopefully making things a little easier on our dev team. To do this, you'll need to use JQuery (and therefore JavaScript), but I'd imagine this is already incorporated. The change is minor; it should be 10 lines at most. Basically, you need to add a new function in your JavaScript doc which identifies the div element surrounding the event box, then add a line which uses ".offset()" to find how far down it is on a given user's device and assigns that value to a variable. With that done, you can make a function that will determine whether the window has a ".scrollTop" value of greater than the value of the variable minus n, where n is how much space should be at the top of the page when the effect takes action. If the window does, invoke ".css({'position':'fixed','top':'y','right':'x'})" on the div element, where y and x represent the desired displacement from the top of the screen and right side of the screen respectively. If the window doesn't, reset the position to static. You may want to add a secondary "if" condition to see whether or not the changes have already been made before invoking them again so as the user scrolls further down the attributes aren't continually applied - that would slow the browser and make the div potentially lag.
Again, if there's anything else I can do to help, I'd be happy to.
Arcanum, the Brandon Sanderson Archive, Is Here!
in Site News
Posted · Edited by Bugsy6912
Clarified some terminology
The site is amazing, and I can't thank all of you who made it enough. I'm going to try to do my little bit here and post how to make a change I think would improve the site, although I'm sure my explanation will be unnecessary thanks to our phenomenal programmers.
If you go to an event page on the site, such as https://wob.coppermind.net/events/127-salt-lake-city-comiccon-2017/, you'll notice that as you scroll down, the navbar at the top of the page attaches to the top and continues coming down for ease of access. I think this is a phenomenal feature (and I know a lot more work goes into something like this than it seems on the surface), so when someone else mentioned that the event box on the side should do the same, I agreed. I then played around in Inspect Element until I figured out how to make that work, hopefully making things a little easier on our dev team. To do this, you'll need to use JQuery (and therefore JavaScript), but I'd imagine this is already incorporated. The change is minor; it should be 10 lines at most. Basically, you need to add a new function in your JavaScript doc which identifies the div element surrounding the event box, then add a line which uses ".offset()" to find how far down it is on a given user's device and assigns that value to a variable. With that done, you can make a function that will determine whether the window has a ".scrollTop" value of greater than the value of the variable minus n, where n is how much space should be at the top of the page when the effect takes action. If the window does, invoke ".css({'position':'fixed','top':'y','right':'x'})" on the div element, where y and x represent the desired displacement from the top of the screen and right side of the screen respectively. If the window doesn't, reset the position to static. You may want to add a secondary "if" condition to see whether or not the changes have already been made before invoking them again so as the user scrolls further down the attributes aren't continually applied - that would slow the browser and make the div potentially lag.
Again, if there's anything else I can do to help, I'd be happy to.