On Google Chrome, printing a Highmap makes it resize and stick to the left. But the map won't take its initial shape after printing. See this Fiddle : http://jsfiddle.net/5u6z7csf/1/
The code is very basic :
$(function () {
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=germany.geo.json&callback=?',
function (geojson) {
var data = Highcharts.geojson(geojson, 'map');
$('#container').highcharts('Map', {
series: [{
data: data
}]
});
});
I tested it on IE and Firefox and it works fine using them.
Is there a way to walk around this problem ?
Thank you for the reporting, it is requested here
Related
I would like to remove Facilities in the layerlist, but still have it show up in the map.
var manned_facilities_back = new MapImageLayer({
url: "http://dotdevgisiis02:6080/arcgis/rest/services/DOT_MAP_PORTAL/Facilities/MapServer",
sublayers: [
{
id: 1,
popupTemplate: templateFT,
},
{
id: 0,
popupTemplate: templateMF,
},
]
I've attempted to add
listmode: hide
or
display: none
under where i have url, but it didn't work. I figure this should be really simple.
Setting the property Layer.listMode to "hide" should work as expected. In your example, make sure you use the correct casing:
var layer = new MapImageLayer({
url: "http://dotdevgisiis02:6080/arcgis/rest/services/DOT_MAP_PORTAL/Facilities/MapServer",
listMode: "hide"
});
Here's a live demo hiding one of the layers from the loaded WebScene:
https://codepen.io/arnofiva/pen/eb198c9b4050b892759ef433e8664fac
EDIT
OK. So I found the problem. It is owl carousel's auto height function. If I remove it the images will load. However, I need that function because the images are all different sizes! What should I do?
Owl carousel seems not to be loading any of the slides. Not sure why because when I preview just locally it works perfectly fine.
Site: http://imdarrien.com/
See the image below (from developer console)
As seen in the image above, you have an error in your Javascript.
Replace
$("#name").mouseover(function () {
$('.slider').stop().animate({
width: $('#name').width()
}, 1000);
}).mouseout(function () {
$('.slider')..stop()animate({
width: 0
}, 1000);
});
with
$("#name").mouseover(function () {
$('.slider').stop().animate({
width: $('#name').width()
}, 1000);
}).mouseout(function () {
$('.slider').stop()animate({
width: 0
}, 1000);
});
Notice the .. in $('.slider')..stop()animate({.
UPDATE
I would recommend you to use the debugger tools to find and solve such simple script issues yourself. Use f12 key to open the debugger tools in chrome.
i have a chrome extension which automatically open a window using
window.open();
when user open some specific websites.
what i want is the new window which i open from the background script through window.open() should be displayed behind the current webiste opened by the user.
i have tried window.open properties like alwaysLowered=1, z-lock=1 etc. but not working.
Also tried.....
var w = window.open('url');
if(w){
w.blur();
window.focus();
}
all these have no effect on chrome. can anybody help?
If you don't need the handle to the opened window (returned by window.open), you can use the chrome.windows API's methods create and update:
In background.js:
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.windows.create({ url: "http://www.google.com/" }, function(win) {
chrome.windows.update(win.id, { focused: false });
});
});
Theoretically, passing the focused: false property in the createInfo argument should achieve the same result in one step, but it is not working for me with Chrome version 31.0.1650.57 on Windows.
UPDATE:
The above code seems to not "blur" the window on Macs. To overcome this (while determining the position and size of the new window - as per OP's comment) use the following code:
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.windows.create({
url: "http://www.google.com/",
width: 430,
height: 150,
top: top_popup,
left: left_popup
}, function(win) {
chrome.windows.update(tab.windowId, { focused: true });
});
});
chrome.windows.getCurrent(function(winCurrent){
chrome.windows.create({url:url, function(win){
chrome.windows.update(winCurrent.id, {focused: true});
});
});
Try this, its fast so viewer doesn't feel much
I'm updating an html5 datalist dynamically, as the user types, with the following script:
$('#place').on('keyup', function() {
$.post('content/php/autocomp.php', { field: 'plaats', val: $('#place').val() }).done(function(response) {
$('#autocomp-places').html(response);
});
});
Which works fine except that the datalist often doesn't show right away. When I inspect the element the html is there but the datalist is not shown as soon as it's updated. How can I force it to show?
For the record: it works... I just wish it would always show the new suggestion right away.
Please use success instead of done method of ajax and try again.
$('#place').on('keyup', function () {
$.post('content/php/autocomp.php', {
field: 'plaats',
val: $('#place').val()
}).success(function (response) {
$('#autocomp-places').html(response);
});
});
I think I just have found a decent workaround for this!
Here is my pseudo-code:
As I type, I make async httprequests to get data.
When data is returned, i clear and re-populate the datalist.
If the current input field is still focused, manually call .focus() on the input element (this seems to force the data-list popup behavior to occur).
First, I would try to use one of already available solutions such as the jQuery UI autocomplete. It will shorten your development time and make the code free of typical bugs (not to mention getting the benefits from someone else work in the future).
If you really want to create your own version, I would make sure the list is cleared and repopulated with the following code:
$('#place').on('keyup', function() {
var posting = $.post('content/php/autocomp.php', { field: 'plaats', val: $('#place').val() });
posting.done(function(data) {
$('#autocomp-places').empty().append(data);
});
});
Here is my code:
$(document).ready(function(){
$(function(){
$('#post_status').iButton({
duration: 200
, easing: "swing"
, labelOn: "Active"
, labelOff: "Hidden"
, resizeHandle: "auto"
, resizeContainer: "auto"
});
});
$('a.copy').each(function(){
var $this = $(this);
$this.zclip({
path : 'path/to/ZeroClipboard.swf',
copy : function(){
var copyText = $(this).prev().val();
return copyText;
}
});
});
});
zClip attach flash objects to elements correctly, but when I click, texts are not copied to clipboard.
If I comment iButton's section, zClip will work fine.
Anyone experienced this issue?
P.S. Works fine on Firefox, but not Chrome
P.S.2 Sorry, for my bad English.
Sample Code : http://jsfiddle.net/nHSbc/
Please find out why if you comment the if line, everything works fine. just in chrome and firefox it has a problem, not in IE. It seems copy function is empty when you click a button.
It might be a miss-configuration problem in using zclip plugin.
Line 63 - 67, File : jquery.zclip.js
//if(!$.isFunction(settings.copy)){
clip.setText(settings.copy);
//} else {
// clip.setText(o.triggerHandler('zClip_copy'));
//}
Cheers