Skip to content

Instantly share code, notes, and snippets.

View stenrdj's full-sized avatar
🎯
Focusing

Aziz Segaoui stenrdj

🎯
Focusing
View GitHub Profile
@stenrdj
stenrdj / ResponsiveJS.js
Last active October 19, 2017 14:35
Responsive code for jquery
// On resizing window on desktop
$(window).bind('resize',function(){
if($(window).innerWidth() < 450) {
// your code here for responsive
}else{
//your code here for desktop
}
});
//end
// Checking if its on desktop and make
@stenrdj
stenrdj / geolocalisation.js
Created September 8, 2017 11:12
JS - Google maps api get zoomed area markers
private boolean isVisibile(Marker marker)
{
if(googleMap != null)
{
//This is the current user-viewable region of the map
LatLngBounds latLongBounds = googleMap.getProjection().getVisibleRegion().latLngBounds;
if(latLongBounds.contains(marker.getPosition()))
//If the item is within the the bounds of the screen
return true;
@stenrdj
stenrdj / geolocalisation.js
Last active September 20, 2017 10:40
JS - Navigator geolocalisation longitude and latitude
if ("geolocation" in navigator) {
navigator.geolocation.getCurrentPosition(function(position) {
// Yes navigator got geolocation and you got permitions to use it
alert(position.coords.latitude, position.coords.longitude);
});
} else {
alert('sorry your browser not support geolocalisation');
}