navigator.geolocation and callback of callback

Initially, I had a code that worked: function get_coords(callback) { //If HTML5 Geolocation Is Supported In This Browser if (navigator.geolocation) { //Use HTML5 Geolocation API To Get Current Position navigator.geolocation.getCurrentPosition(function(position) { //Get Latitude From Geolocation API var lat = position.coords.latitude; //Get Longitude From Geolocation API var lng = position.coords.longitude; callback([“coords”, lat, lng]); }, function() { callback([“geoloc_deactivated”]); }); } else {…
Read more

html css tr set width

I have the HTML table & its CSS. CSS : #outerDIV { position: relative; padding-top: 20px; } #innerDIV { overflow-y: auto; height: 500px; } table#mytable tbody tr:first-child { width:100%; position :absolute; } HTML : <div class=”outerDIV”> <div class=”innerDIV”> <table id=”#mytable”></table> </div> </div> I need the fixed header tags of table, so is the above code does, but the width of…
Read more

How to use servlets and Jquerry+bootstrap?

I have button: <button id=”saveFeed” type=”button” class=”btn btn-primary”>Save changes</button> in form: <div class=”modal fade” id=”myModal”> <div class=”modal-dialog”> <div class=”modal-content”> <div class=”modal-header”> <button type=”button” class=”close” data-dismiss=”modal” aria-label=”Close”> <span aria-hidden=”true”>&times;</span> </button> <h1 class=”modal-title”>Edit feed name:</h1> </div> <div class=”modal-body”> <input type=”hidden” readonly=”readonly” name=”id” value=”<c:out value=”${feed.id}” />” /> <p>Enter feed name:</p> <input id=”feedName” type=”text” name=”name” value=”<c:out value=”${feed.name}” />” /> <!– <input id=”feedName” type=”text” name=”feed…
Read more

jQuery selector not running inside function called by ajaxcomplete

I need to replace some text in an element that is created dynamically. I tried: $(document).ajaxComplete(function() { console.log(‘I started’); $(“.classname:contains(‘foo’)”).html(‘bar’); console.log(‘I finished’); }) The function starts and finishes just when I want it to, but the selection and replacement never happens. If I just run the replacement in the console, after the element exists, it works fine: > $(“.classname:contains(‘foo’)”).html(‘bar’) >…
Read more

Responsive image slider made with fullPage.js

I want to make a responsive image slider with fullPage.js. The images should be always centered and expand to maximum 75 percent width or height of the window. Below the centered and expanded images I want to display the title of the images. My approach was to work with background images. But now I can not place the title directly…
Read more

fancytree adds html code 

I Have a problem with Fancytree to add a new node. If I add a node with normal text it works, but if i add text with div or span, it wont work. if I check the fancytree-title it’s somthing like this: <span class=”fancytree-title”>  <span class=”lvl1_title pull-left” data-pageid=”test”>test</span> <span class=”page_link pull-left”> (<a href=”test.html”>test</a>)</span> </span> It does add me this…
Read more

What closed a foundation modal in closed event?

Using Foundation 5 modal dialogs. Is there a way to pass what fired the close event. Like a button or a link? Something like this. I tried using the data attribute but that doesn’t seem to work. $(‘#cancelbutton’).on(‘click’,function() { $(‘#mymodal’).foundation(‘reveal’,’closed’,{data:’cancelbutton’}); }); $(document).on(‘closed.fndtn.reveal’, ‘[data-reveal]’, function (e) { var closer = e.data; }); Source: jquery

jQuery global focus hook

In my focus manager I need to store some info on the last focus and blur. I need to delegate this hook to body, but if I use * as a filter I will receive the focus event for every parent item of the actual thing getting focus. Realistically, I could make a filter to accept something like a, input,…
Read more