Author Archives: itsjoeyoung

Article Viewing Concept

So this week I took a step back from jQuery Mobile to create a spike for the project. Sompop and I were tasked to create a starting point for the content frames or what I will refer to as the Article Viewer for the app.

We received some guidance with regard to concept from the WAM project leader, so our goal was to bring the concept to life. Since this wasn’t a jQuery Mobile specific task it does not include the mobile library.

The first step was a basic CSS and HTML template that was static and looked like the concept with no functionality. Here is a basic layout sketch, his example was obviously much more attractive however the core concepts are there.
Image of basic concept

So that was relatively easy to create in HTML/CSS, the only task was keeping the images in a static location (this was done with the CSS attribute “position: fixed”.
The next step was to add some functionality, how can we bring this to life! the first issue was having the ability to display many images in the image container. There are multiple ways that this can be done, one of which would be dynamically loading the images based on what link was clicked. This solution however would have potential for slow response time while the used was trying to view the images. Another solution i thought of was to have all the images displayed in a frame, but experience has taught me that use of frames is not a good thing. So my goal was to simulate a frame without actually using a frame! to accomplish this I essentially used the Image container as a window to underlying divs. here is the concept drawn out:Layout Concept

This was accomplished by simply nesting the divs inside of the image container div and applying the “Overflow:Hidden” CSS attribute. I found this to  be a nice solution because it essentially loads all the images in advance creating a seamless transition. The next step was how to make these transitions, which is surprisingly  easy with the jQuery animate function.

The transition is ended up deciding on was a slide, i accomplished this by animating a change in the margin. Essentially multiplying the image index in its respective row with the width of the images, the code looks like “$(this).animate({ “marginLeft” : -i*imageWidth+”px”}, 1000) ” what that does is animates a CSS change of the margin over the course of 1000ms or 1 second. this worked flawlessly, regardless of what image the user selects the animation always takes 1 second and is smooth based on the jQuery animate function. the same concept was used for rows except the CSS attribute modified was the marginTop.

Upon use it became noticeable and relatively irritating that when you switched rows it remained on the last viewed image, which i felt was an annoyance. To fix this I added a line of code that reset all rows margin-left to 0 except the one being view. This was a challenge since the rows programmed dynamically, however after looking into jQuery selectors this didn’t take long at all. I had issues with the :not selector working so I came up with an alternative method which was to modify all rows with and index greater than or less than that of the selected row. The code looks like this “$(imageRow:gt(rowIndex),imageRow:lt(rowIndex)).animate(…);”  this also worked seamlessly and in conjunction with the other animation. It actually created an interesting effect showing the rows resetting and the newly selected row being show and moving depending on the image selected.

Regardless of whether or not this is used in the final stage of production I had quiet a few take away’s. That wraps up my recent spike contribution to the git under “master/Spike/contentViewerConcept

From the blog itsJoe's Blog » cs-wsu by itsjoeyoung and used with permission of the author. All other rights reserved by the author.

jQuery Mobile

What is JQuery Mobile?

jQuery mobile is essentially a mobile app development platform that builds upon jQuery:

“A unified, HTML5-based user interface system for all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight code is built with progressive enhancement, and has a flexible, easily themeable design.”

jQuery Mobile Website

A mobile Javascript Library, sounds like exactly what we are looking for!

Where did I start?

I have experience with jQuery so I guess one could say this was started two years ago. However the mobile framework is completely new to me. I would recommend basic jQuery tutorials in addition to javascript tutorials. But my jQuery Mobile adventure began at Google  when I took a shot at searching “jQuery Mobile” I then continued to download jQuery Mobile 1.2.0 and jQuery 1.9.0.
Like most things you need walk before you run, so I started with a very basic hello world interface.
Step1: Setup the website
I always recommend the boilerplate folder setup:

css/style.css
js/jquery.js
js/jquerymobile.js
js/script.js
index.html

Style.css is not necesary however i always recommend it for custom styles.

Here is the basic index.html code with notes:

<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
<!-- Importing all required sources -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.css" />
<link rel="stylesheet" href="css/style.css" />
<script src="js/script.js"></script>
<script src="js/jquery.js"></script>
<script src="js/jquerymobile.js"></script>
</head>
<body>
<!-- The basic jQuery Mobile Setup is Header, Content, Footer there are defined as 'data-roles' attributes
     the data-role attribute is used extensively with jQuery Mobile -->
<div data-role="header"> <h1>This is the Header!</h1> </div>
<div data-role="content"> <p>This is the content!</p> </div>
<div data-role="footer"> <h3>This is the footer!</h3> </div>
</body>
</html>

This should look like this:

This is the extremely basic level of a jQuery mobile app! From here you can do more from this point, jQuery is very well documented so i would recommend going to their doc page which can be found on their website. here are some other screenshots of stuff that I was working with:
Here is a reactive concept I am working with!

Here is a basic testing page:

I hope to be posting more about this, however it is still very new to me. I am open to comments or suggestions!

From the blog itsJoe&#039;s Blog » cs-wsu by itsjoeyoung and used with permission of the author. All other rights reserved by the author.

First Week

The team got together for the first time and met with the clients. My first impression would be that the clients are as excited about the opportunity to work with the students as they are about the concept of an interactive exhibit. This should prove to be helpful, especially with regard to ensuring customer satisfaction.
I am looking forward to the planning process especially since I have only ever worked in a 2 man team. The development process that Dr. Wurst has proposed seems interesting and highly practical for web/app development. A working product every week; it should be interesting to go back and view snapshots of the app on github. I am eager to get working on the project!

From the blog itsJoe&#039;s Blog » cs-wsu by itsjoeyoung and used with permission of the author. All other rights reserved by the author.

First Post of the Semester

Just about to get started with the CS401 project; first time blogging so this should be an experience.

From the blog itsJoe&#039;s Blog » cs-wsu by itsjoeyoung and used with permission of the author. All other rights reserved by the author.