I am stuck with modal: How to put text inside of one - java

Total noob here.
I am in the process of building my hobby website and feel that I could, with some hard work, create a fully functional site. However, I am rather stuck on modal popout window.
I understand the basics of getting one to work, i.e. download jquery or related java library, attach said library to webpage in the section. Apply modal popout in similar way making sure to include the CSS for it.
I can get it to function in my site, so with Shadowbox I managed to get it to actually popout. Where I am stuck, with Shadowbox in particular, is actually putting stuff inside the modal popout. I am really only interesting putting text in the modal popout with maybe a link or small picture to compliment the text.
What is hindering me is my lack of knowledge. This may be either a lack of understanding with regards to class attributes or href attributes, or a lack of knowledge. The only progression I have made with this is simply because of the copy and paste, and some image path manipulation with Shadowbox. I am still horribly confused as to how the script activates, what tags/attributes I need to make to ensure data within a is included in the modal popout window.
I would really like to have a modal popout like this http://typedeskref.com/ but feel that this is far, far beyond me.
In summary: I don't know how to put text/images inside of a modal popout. I don't know how a modal popout is activated and how to ensure I can control what is kept inside of it. The reason why I say this is because the limited sucess I have had with Shadow box is because it has somehow managed to pick up everything that is on my site, images, links etc. So when the modal popout is opened, there is my site, in modal form.
Thanks for taking the time to read this. I really appreciate any help or advice you can give me. Even a shove in the direction where such information can be located would be great!
p.s. I am using dreamweaver cs5

Depends on how crazy and amazing you want your dialogs to be. It could be something as simple as downloading jQuery UI Dialogs (http://jqueryui.com/demos/dialog/) and then doing this.
<div id="dialog">Hello</div>
<a id="button1">One</a>
<a id="button2">Two</a>
// Do the setup when the page has loaded
$(function() {
// Create the dialog, don't show it on page load
$("#dialog").dialog({autoOpen:false});
// Button One will show the dialog
$("#button1").click(function() { $("#dialog").dialog("open"); });
// Button Two changes the content, THEN shows the dialog.
$("#button2").click(function() {
$("#dialog").html("Goodbye");
$("#dialog").dialog("open");
});
});
It's a starting point. Same dialog, changing the content, triggered by clicking a link. That library has all manner of options (animations, etc) and you can style it to whatever look-and-feel you like.
Here is a demo: http://jsfiddle.net/dYMvH/

Related

How to code an expandable pane/panel/card

I added an image below to show what i am trying to achieve. I've seen similar implementations of this else where but isn't sure what it's called.
What it will do is when a box/panel/card on the left is clicked, a detailed panel on the right will be displayed, showing very detailed information. If a user simply wants to see a little more, an arrow or a "show more" hyper link will expand the panel/card to display more information.
I'm wondering if some sort of java plugin is already in existence which i can modify and utilize to fit my needs, instead of coding the entire thing from scratch.
If anyone has any idea of this, i would love to hear more! Thanks in advance!

GWT-508 compliant- How to set HTML tags

I am in the process of making my GWT page 508 compliant and I need to add some additional information on the sort buttons in my cellTable for the screen reader to pick up. Basically I need to know how to set the Label HTML tag from the cellTable.
I know how to use the setTitle() and setAlt() methods but I can't seem to find an easy way to set the Label for buttons. I understand screen readers can optionally view Title tags but that is not what I want to have to do.
I cant seem to find anyone else out there with this problem, how has this not come up more?
There's a TODO in the code actually: https://gwt.googlesource.com/gwt/+/2.6.0/user/src/com/google/gwt/user/cellview/client/DefaultHeaderOrFooterBuilder.java
// TODO: Figure out aria-label and translation of label text
and there doesn't seem to be any hack/hook to add it.
So the only solution seems to be to fork/patch GWT (and if possible contribute the patch upstream).
BTW, the sort icons are not buttons, just indicators. The whole table header responds to click, so the aria-label has to be added to the <th> element.
(well, actually, there seems to be a workaround: walk the table DOM looking for the appropriate <th> element and add the aria-label attribute using Roles.getButtonRole().setAriaLabelProperty(); but fixing GWT would be less fragile, much better in the long run and good for everyone)

Jquery Visitor notify box

I am looking to create a Slide up box, how I would want this to work is when someone visits the site a small box would popup in the right corner of the site that has text in it which could say hey register to the site or just informer the visitor of some information that is going on.
I would want this to be free to customize like css wise so this box can fit the site look, if anyone know about any guides or have the code it would be really helpful.
I tried googling it but could not find what I was really looking for, since most of them only pop-up when you click a button, I want this to slide up automatically and have a x button which allows the person to make the box disappear, and I would want one that just lets it show/hide.
Try taking a look at this:
http://ned.im/noty/
It may be what you're looking for!
You can customize it to your liking too :)

Adding a Basic Java Program into Website

Firstly I am no longer a student and doing this for other purposes, so don't hold back on the help ;)
I want to incorporate a simple program into my webpage. I want 4 buttons labelled right arm, left arm, activate voice and walk forward. There will be a box above these buttons showing an image of a robot and as the buttons are pressed by the user I want a different image to be loaded in the box.
So if the right arm button is pressed the image with the robot raising its right arm will need to be displayed.
So basically all I want the buttons to do is to load the image that belongs to each one. I am assuming java is the best choice? I have the open source Java package, would I need any other software when it comes to embedding it into a webpage? My webpage is done on dreamweaver and I am pretty good with html. Would appreciate it if someone could point me to the right direction.....Thanks
Don't use Java for this. Use JavaScript. Something like this:
HTML:
<img src="one.jpg" id="firstImage" />
<img src="two.jpg" id="secondImage" />
​<button id="doSomething">Do Something</button>
<button id="doSomethingElse">​Do Something Else</button>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
CSS:
​img {
display: none;
}​
JavaScript:
var hideImages = function() {
$('#firstImage').hide();
$('#secondImage').hide();
};
$('#doSomething').click(function() {
hideImages();
$('#firstImage').show();
});
$('#doSomething').click(function() {
hideImages();
$('#secondImage').show();
});​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
What this essentially does is initially display no images, just buttons. Then as each button is clicked, the corresponding image is displayed. (And all other images are first hidden, since previous button clicks would have displayed previous images.)
This is an overly simple proof of concept, of course. At the very least you'll want to use better variable names :) This just demonstrates the idea of how you'd show/hide images in JavaScript in response to button clicks. (This also assumes the use of jQuery, which is a safe assumption these days. The easiest way to use that is to refer to a CDN link in your page, using a standard HTML script tag.) You can see this code in action here (though the images are broken, of course.)
If there are a lot of buttons and a lot of images, you may be able to re-factor the code to be less repetitive as well. Maybe store the images in an array and have a single button click handler which can associate the sending button with the correct array element, etc. That's up to you.
There are many technologies that could help you: javascript is one of them and it would be much simpler than using Java for such simple thing. You can use Java applet if you really want to use Java for that project.

Working in java image

I will explain my question clearly.
I need to zoom in/zoom out the world map.
When I click on the particular country in map, control should redirected to new page with respective the country.
I dont have any idea about this in java. Please explain the steps to acheive the above task.
As the question is quite general, here is a general answer: Zooming often means, that you want to display a certain percentage of somethin, and not the whole, where your size of the displayed will not change.
But in your case it seems more like a "find a mouse click in a polygon" thing. So you have to add a selection/click listener to whatever widgets you use (Swt? swing? ....?) where you change what your program renders.
It sounds like you may be trying to reinvent the wheel. Google etc have already solved this problem rather well. It might be better to incorporate an existing solution into your application. Have a look at GoogleEarth inside Java Swing.

Categories

Resources