I am using the fasw javascript library - http://www.fasw.ws/faswwp/non-jquery-page-transitions-lightweight/ - to do page transitions in a webapp. It can only appear to be triggered via a data attribute on a link.
$('body').prepend('<a class="decider_link_trigger" href="#">[Trigger]</a>');
$('.decider_link_trigger').attr('data-ftrans', 'flip');
$('.decider_link_trigger').attr('href', selected.result);
$('.decider_link_trigger').trigger('click');
The above code adds such a link to the page with the provided data-ftrans attribute and is even clickable manually, but I can't figure out how to submit the link with jQuery (or event Javascript).
I cannot do a manual window.location.href = selected.result; as this will not use the transition library.
Thanks!
Related
I have a twitter timeline embedded on my site and I want it to automatically scroll to the bottom of my timeline. Auto scroll is working, but the embedded version of twitter has a "Load More Button" that needs to be activated in order for the timeline to scroll any further down.
Some other things I have tried are getting the class name using the google developer tools, but that doesn't seem to work either. I am not sure if I can actually access those because those classes are not directly stated in my HTML file. Currently I am thinking that I need to first get the class name of the embedded timeline, then from there in the same function access the load more button HTML class.
If the twitter timeline is embedded in an iframe, calling the global document object refers to the main DOM, but the nested iframe has its own. Just use window.frames["nested-frame-name"].document instead.
Using your code example you should correct
var loadMoreButton = document.getElementsByClassName("twitter-timeline");
into
var loadMoreButton = frames["twitter-frame-name"].document.getElementsByClassName("twitter-timeline");
I'm writing a web application using HTML, Javascript and AngularJS. For my UI I'm experimenting with LumX. I tried Angular Material but it was way too slow on IE.
However, I'm having difficulty simply submitting a form using LumX. The reason is I can't get the button to work. The LumX site clearly states:
"lx-button is a directive that create a link element if you specify a href or ng-href attribute
Otherwise, it creates a button element."
Here's what I have:
<lx-button id="add_button">Button</lx-button>
Then, in my functions.js file I have:
document.getElementById('add_button').addEventListener('click', add);
The add( ) function simply adds that item to a list. The function is working, because the program works as intended with a normal button. It's just when I use the lx-button tag that it stops working.
Thanks.
I'm using a Javascript, Jquery , Backbone.js page. I have all the code in the same file, so I don't want to change between HTML files. I don't use Backbone.js routes. I want to change the URL dynamically and I used history.pushState() function, and it works correctly. But when I click to some parts of the website, the URL returns to the inital one. I don't know why...
I found the problem!!
My code has a hidden . Clicking an anchor with href="#" will move the scroll position to the top. But in my case it causes an unwanted behavior.
I'm using uk-modal on a project.
As you can see from the documentation, to open a modal via a link this is what you do:
Modal
I really need to have the bgclose:false set (so that the modal does not disappear on clicking on the background).
The point I need to reach is to open the modal via Javascript (and not on a link as above).
This is the normal script I would use (shortened):
UIkit.modal("#modal_loading").show();
On the documentation I cannot find the way of setting the bgclose to false via Javascript.
The workaround I made for now is to make an invisible (display:none) link as above and trigger its click event:
$('#open_loading_modal').trigger('click');
But this is ..... boring.
How do I set bgclose to false via Javascript?
I found the answer:
UIkit.modal("#modal_loading", {bgclose: false}).show();
I'm doing some ASP using Telerik.
On my page there are 2 buttons called Create Window and Postback. The Create Window button created a new RadWindow dynamically on it's click event (client-side) by using window.radopen(). The Postback button simply does a postback. My problem is that, the windows get lost after every postback. What can I do to make my RadWindows to remain opened after a postback, including its content and position.
If there is no built-in function to restore my dynamic RadWindows, please tell me how to save current windows content to manually load it on the next postback. I thought of using a Hidden control to save my RadWindow position and content, but how can I do that (it's content is a user control with plentiful textboxes, and i don't want my customer to re-type all the textboxes).
The RadWindows are generated via JavaScript when they are first shown. You can easily check this via your developer plugin of choice. Once you show them they create their wrapper div as a direct child of the form element. This means that they have no server-side rendering and thus cannot be persisted on the server across postbacks.
What you can do is use AJAX - have the button perform an AJAX request that will update the needed content of the page, but will leave the RadWindows out of the update. Check out this help article where they explain how to use AJAX with a RadWindow: http://www.telerik.com/help/aspnet-ajax/radwindow-ajaxifying.html.