Issue with JavaScript scrolling bar - javascript

I'm helping someone out with a ticker at the top of their page but for some reason I just can't get it to appear.
http://www.javascriptkit.com/script/script2/verticalscroller.shtml
^ that's where I got the code for it. Is it possible I'm missing something? I'm not very fluent in JavaScript, but it works on a page by itself. But as soon as I copy paste it into the page it's suppose to go to, it won't appear.

Related

Need to make browser back button go back to previous page root url sitewide on Wordpress

I have a particular problem on a site that I'm working on and can't seem to get things working on Wordpress. I have a tab section of the site that uses # to function properly. I also have anchor links to these sections as well. Everything works great, but when I navigate off of the page and click the browser back button, I have to click through each # until I get to the root page. I realize that this is the normal browser behavior, but need to find a workaround if possible. I've tried all sorts of code, and could post some things I've tried but nothing is working thus far. Any help would be greatly appreciated.
Thanks so much

Javascript back button not working properly -scrolling to the bottom of the page, instead of previous scroll location

I'm using the following code on a wordpress website and it is only present on the post pages:
<button onclick="history.back()">Back</button>
What I would like the code to do is bring the user directly back to the spot where they left off on the previous page and for the most part the code is working fine.
Problem: After clicking forward and then clicking back a few times - the back button will continue to bring you back button, however not to the same scroll spot - it actually brings you back to the bottom of the webpage and will keep doing this every time until you leave the website and then return.
Any help with this problem will be greatly appreciated.
Here is my website address - if that helps >> http://rumpleskilton.com/djs-bands-singers/
(to see the problem - select one of the listings and then click the back button, which is just above the page header. It could take several times to see the problem. Just click a few of the listings.)
have you try this way ?
<button onclick="window.history.back()">Back</button>
i hope it's help you.
I believe you are using Chrome. Chrome is known to demonstrate such behaviour. Try with Firefox and MS Edge and see if you get the same result (I trust you won't).
In any case, the safest method is to use the page URL to navigate to, instead of back(). Alternatively, you could save the last page name in the url (?lastpage=index or whatever) and change your back() function to grab that page name and navigate there.
Trusting the browser behaviour is not your friend in this situation.

IE11 wierd behaviour -- JavaScript works only after reloading a page

I have a website prototype https://arcane-beyond-35849.herokuapp.com/
I have a strange bug. In internet explorer v11.
please go to the site and press new button.
You will see this picture...
Then you can reload the page and see this...
I use the jQuery steps wizard.
So I have no idea why the first time everything breaks.
(If you need a code I can provide it just tell me.)
$(".myform").steps({
*some stuff and options
});
Okay I found another weird behavior when you go to the main page and try to click on the menu button in the right top corner nothing happens.
When you reload a page and click menu button again side menu appears.
I simply on document.ready use something like this :
$('.somebutton').click(function(){});
I guess I should provide code and I will do it as soon as get to another laptop. But if take away all business logic The code is as simple as I described.
In google chrome everything works normal.
Can someone help? Seems like my JavaScript code just doesn't execute.
Update:
okay guys Console give me some errors. My IE11 not in English so no point to post exact errors here.
There is something about the content that is loaded over http when I have https.
But it's just a placeholder picture. So I don't know. And when I reload page my JavaScript code works. So this is strange.

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page.
For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth.
The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/
Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way.
Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided?
P.S.: On my real site the same occurs with Chrome. In the example fiddle Chrome seems to not show the same behaviour as Safari, though.
Edit: I also tried to have the printing button on a different tag than an a anchor, like span or button, but that didn't help with the problem.
Edit: I run into this problem with Safari 5.1.2 on Mac OS 10.6.8. In the jsfiddle example, the behavior shows as a white "flicker" that covers the whole browser after having clicked the print button and closing (either printing or aborting) the print dialogue.
Edit: Just started a bounty for this question, as I am still looking for an explanation for this browser behaviour. I am more than willing to give more details on the issue. From my experience on SO it is not adviseable to post links to online pages, however I feel the problem is really hard to reproduce. I think the "flicker & re-render" I experience with the posted jsfiddle is hopefully is result of the same problem.
Edit: As explained in the comments, opening a new window containing the current state of the application, then printing and closing that window, might be a fix, but I don't consider it a sufficient answer to the problem at hand.
If you can't figure a way to fix the problem you might get a quick fix this way:
var win=window.open() the same page you are on
then win.print() it, then win.close(). Hope this helps.
Sadly, I don't have a solution. but since I was able to reproduce this in Safari and Webkit with the fiddle, I thought I'll at least offer my observations:
The white-out doesn't happen if you hit Print dialog button right away. You need to wait few seconds before you hit Print to be able to see the white. On OSX 10.6.8 I see the threshold marked by appearance of the spinning beachball.
When the mouse stays stationary since the Print button hit, the page stays white until you move the mouse again (beachball still spinning).
Hope this will help somehow.
I'm not sure if this will fix your problem but i recently found a very good Jquery plugin to print only certain part of your webpage.
You should give it a try :) It has a some very cool parameters to customize it to your needs.
Take a look here.
Why does your page refresh? Here's my answer on that. the window.print() function will print the entire content of your page. So since i read that you only want to print a part of the page, I guess you are using some function to remove all unwanted content from the page for a very short moment, then you call the window.print() function and after that you put all orignal content again on the screen. This results in a very short flash that will look like your page is refreshing and will load all flash parts again.
I had the same problem yesterday and this jquery plugin really helped me out. I hope it will help you too.
Have a nice day!
Since it seems window.print() is not part of any standard, browsers are free to implement it in any way they choose.
The only work-around I can see, if you really have to leave the page as-is, would be to open another window and print that. Which is a whole other, possibly worse, can of worms.
Try this in your function:
document.write("<script type='text/javascript'>window.print()</script>");
I am referencing this stack:
After window.open, can't print in Safari for Mac
Update, Try:
document.writeln("<script type='text/javascript'>window.print()</script>");

jQuery not working on this page in any browser. I can't figure out why!

http://www.fireviews.com/testing/tabs_and_toggles.html
The buttons with + signs are supposed to be drop-down toggles, and the mini-tabs below them should function as tabs. And at the bottom, the sample images should load (not just the spinning loader) and when clicked they should magnify the image, not go to another page. Also the magnifying glass in the top right should pop up a search bar when moused over. But none of this is working!
I think it may have something to do with the directory the js files are in (as I had to move them from their original location) but I thought I changed all the paths properly.
Can anyone help me identify where the errors/problems are?
You need to use debugging tools that will reveal JavaScript errors to you. Just by opening your page in Firefox, I get:
Error: jQuery("a[rel^='prettyPhoto'], a[rel^='lightbox']").prettyPhoto is not a function
Source File: http://www.fireviews.com/design/js/custom.js
Line: 239
And if I look at your JavaScript files, I see that http://www.fireviews.com/design/js/prettyPhoto//design/js/jquery.prettyPhoto.js is not actually JavaScript. That's your problem.
See: What is a good Javascript debugging tool?
Your prettyphoto.js is actually a HTML file.

Categories