Im trying to get a map similar to this for when you click on the region of the map a div appears to the right and shows you the closest stores in that region
http://www.kaiwakaclothing.co.nz/our-stores.php
I have been using this website below for the code;
http://www.randomsnippets.com/2008/02/12/how-to-hide-and-show-your-div/
and have implemented using hotpoints in dreamweaver to do the following
http://www.colmanweb.co.nz/websites/betacraft/index.php?option=com_content&view=article&id=31
however I cannot seem to get different text or hidden div to appear for each region.
Sorry I managed to fix this problem
added
<script language="javascript" type="text/javascript">
// <![CDATA[
function togglewai() {
var ele = document.getElementById("toggleText2");
var text = document.getElementById("displayText");
if (ele.style.display == "block") {
ele.style.display = "none";
text.innerHTML = "show";
} else {
ele.style.display = "block";
text.innerHTML = "hide";
}
}
// ]]>
the key was changing the name function toggle to togglewai
Related
I need to custom a google form, want to hide google logo and back button on second section
i tried a function like this :
function myFunctioncss() {
function onOpen() {
var myLogoDeGoogle = document.querySelector(".freebirdFormviewerViewFooterImageContainer.freebirdFormviewerViewFooterPageBreak");
myLogoDeGoogle.style.display = "none";
var myBoutonRetour = document.querySelector(".quantumWizButtonPaperbuttonEl.quantumWizButtonPaperbuttonFlat.quantumWizButtonPaperbutton2El2.freebirdFormviewerViewNavigationNoSubmitButton");
myBoutonRetour.style.display = "none";
var myTitreTest = document.querySelector(".freebirdFormviewerViewItemsItemItemTitle.freebirdCustomFont");
myTitreTest.style.color = "red";
var myFond = document.querySelector(".freebirdFormviewerViewFormContent");
myFond.style.background = "green";
}
}
With a trigger on form open.
Not Errors but it does not change anything on the form.
All ideas will be welcome..
How to hide navigation menu bar on scroll down and it should appear on scrolling up using angularjs?
As I have seen a solution that library 'headroom.js' is quite useful but I am unable to implement.Please suggest an appropriate solution.
Can it be done with JQuery? I am using code like this in my app, you can use it in AngularJS if you use angular.element(document).ready.
// Navigation Scripts to Show Header on Scroll-Up
jQuery(document).ready(function($) {
var MQL = 1170;
//primary navigation slide-in effect
if ($(window).width() > MQL) {
var headerHeight = $('.navbar-custom').height();
$(window).on('scroll', {
previousTop: 0
},
function() {
var currentTop = $(window).scrollTop();
//check if user is scrolling up
if (currentTop < this.previousTop) {
//if scrolling up...
if (currentTop > 0 && $('.navbar-custom').hasClass('is-fixed')) {
$('.navbar-custom').addClass('is-visible');
} else {
$('.navbar-custom').removeClass('is-visible is-fixed');
}
} else if (currentTop > this.previousTop) {
//if scrolling down...
$('.navbar-custom').removeClass('is-visible');
if (currentTop > headerHeight && !$('.navbar-custom').hasClass('is-fixed')) $('.navbar-custom').addClass('is-fixed');
}
this.previousTop = currentTop;
});
}
});
Thanks to this post: scroll up/down detection
You can use this:
var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel" //FF doesn't recognize mousewheel as of FF3.x
$('body').bind(mousewheelevt, function(e){
var evt = window.event || e //equalize event object
evt = evt.originalEvent ? evt.originalEvent : evt; //convert to originalEvent if possible
var delta = evt.detail ? evt.detail*(-40) : evt.wheelDelta //check for detail first, because it is used by Opera and FF
if(delta > 0) {
$('.menu').fadeIn();
}
else{
$('.menu').fadeOut();
}
});
There is an example solution you can check out here. It is solved using CSS and JQuery.
I am having HTML page where i ll have link as "SHOW" while clicking on that I need to show div area. where DIV has iframe.
Normally while loading HTML page that div should be in hidden state while clicking only it should be shown.
I need close button inside that link..While clicking on that I need to close the dive that is hide.
a
function toggleDisplay(id)
{
if (!document.getElementById) { return; }
var el = document.getElementById('straddle');
if (el.style.display == ''){
el.style.display = 'none';
}else {
el.style.display = '';
}
}
I don't want this toggle function
Please help me.
Your javascript
<script type="text/javascript">
<!--
var whatever = document.getElementById('mydiv');
whatever.style.display = 'none';
function show(){
whatever.style.display = 'block';
}
function hide(){
whatever.style.display = 'none';
}
//-->
</script>
and then the HTML
Click here to show element
<br/>
<div id="mydiv">
This will disappear and reappear and
Click here remove element</div>`
You may want this (Iframe may take a while to load, so let it load)
HTML:
Show
<div id="straddle">
<div id="close">Close</div>
<iframe width='100%' src="http://heera.it"></iframe>
</div>
JS: (Put it before closong </body> tag between <scripe type="text/javascript"></scripe>)
window.onload = function() {
var show = document.getElementById('show'),
el = document.getElementById('straddle'),
close = document.getElementById('close');
show.onclick = function() {
el.style.display = 'block';
return false;
};
close.onclick = function(){
el.style.display = 'none';
};
};
Update : Added relevant css
#straddle{ display:none; }
#close{
float:right;
cursor:pointer;
display:inline-block;
}
Use jQuery:
$(document).ready(function() {
$('#link1').click(function() { $('#div').css({ display:'none' }) })
$('#link2').click(function() { $('#div').css({ display:'block' }) })
})
I'm using Google maps in my academic project,from few weeks onwards a message in displaying on map whenever I do certain operations on map like zoom-in,zoom-out.What might be the reason?Is I need configure any thing in my code.
You can see that message in above image,message is titled by 'Map Data'.We are using open layers maps in our project and coding language is PHP.
I read here that one cause might be some element covering up the map data copyright, but I found some complaints of the same notice popping up without mentioning this.
The most promising option I found is a page saying the solution is to upgrade to 2.12 or if you cannot, then apply a patch after including the OpenLayers.js
<script src="http://maps.google.com/maps/api/js?v=3.5&sensor=false"></script>
<script src="../lib/OpenLayers.js"></script>
<script>
OpenLayers.Layer.Google.v3.repositionMapElements = function() {
// This is the first time any Google layer in this mapObject has been
// made visible. The mapObject needs to know the container size.
google.maps.event.trigger(this.mapObject, "resize");
var div = this.mapObject.getDiv().firstChild;
if (!div || div.childNodes.length < 3) {
this.repositionTimer = window.setTimeout(
OpenLayers.Function.bind(this.repositionMapElements, this),
250
);
return false;
}
var cache = OpenLayers.Layer.Google.cache[this.map.id];
var container = this.map.viewPortDiv;
// move the ToS and branding stuff up to the container div
// depends on value of zIndex, which is not robust
for (var i=div.children.length-1; i>=0; --i) {
if (div.children[i].style.zIndex == 1000001) {
var termsOfUse = div.children[i];
container.appendChild(termsOfUse);
termsOfUse.style.zIndex = "1100";
termsOfUse.style.bottom = "";
termsOfUse.className = "olLayerGoogleCopyright olLayerGoogleV3";
termsOfUse.style.display = "";
cache.termsOfUse = termsOfUse;
}
if (div.children[i].style.zIndex == 1000000) {
var poweredBy = div.children[i];
container.appendChild(poweredBy);
poweredBy.style.zIndex = "1100";
poweredBy.style.bottom = "";
poweredBy.className = "olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint";
poweredBy.style.display = "";
cache.poweredBy = poweredBy;
}
if (div.children[i].style.zIndex == 10000002) {
container.appendChild(div.children[i]);
}
}
this.setGMapVisibility(this.visibility);
};
</script>
<script src="google-v3.js"></script>
Currently I was asked by my Client to Display Curved Fonts lie word art and customize some of the Text fields with this Font.Can we Load the WordArt directly into Fash Textfield?can we Do it by Embedding or any technique (purely with Scripting)?
No, there is no such thing in AS3. A good way to do it would be to create a text field and switch around the pictures inside of it using code
imgbtn1.onRelease = function() {
infoField._visible = true;
startLoading("picture1.jpg");
};
imgbtn2.onRelease = function() {
infoField._visible = true;
startLoading("picture2.jpg");
};
imgbtn3.onRelease = function() {
infoField._visible = true;
startLoading("picture3.jpg");
};
function startLoading(whichImage) {
loadMovie(whichImage, "imageLoader");
_root.onEnterFrame = function() {
infoLoaded = imageLoader.getBytesLoaded();
infoTotal = imageLoader.getBytesTotal();
percentage = Math.floor(infoLoaded/infoTotal*100);
infoField.text = percentage+"%";
if (percentage>=100) {
delete this.onEnterFrame;
infoField._visible = false;
}
};
}