A 2 (or multiple) row responsive fluid layout, one row has fixed width, all rows have same height, a margin is between rows.
It collapses in mobile resolutions.
The code is minimal, no freaky negative margins or paddings. Everybody should be able to use it.
Fluid width row
Your bones don’t break, mine do. That’s clear. Your cells react to bacteria and viruses differently than mine. You don’t get sick, I do. That’s also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We’re on the same curve, just on opposite ends.
(Text by http://slipsum.com)
Fixed width row
Change browser width to see it respond.
With this snippet you can show a static google map image for a specific location, which is linked to google maps and includes showing a marker in all views.
Don’t forget to change YOUR_GOOGLE_STATIC_MAPS_API_KEY to your api key, which you can get at https://console.developers.google.com by creating a server key and aactivate google maps for this account.
$address = urlencode("Kupferbergterrasse 10, 55116 Mainz");
$request = file_get_contents("https://maps.google.com/maps/api/geocode/json?address=" . $address . "&key=YOUR_GOOGLE_STATIC_MAPS_API_KEY&sensor=false", false, stream_context_create($arrContextOptions));
$json = json_decode($request, true);
$lat = $json['results']['geometry']['location']['lat'];
$lng = $json['results']['geometry']['location']['lng'];
$marker = "color:blue|label:ZIEL|".$lat.','.$lng;
echo '<a href="https://www.google.com/maps/place/'.$address.'"><img src="https://maps.googleapis.com/maps/api/staticmap?center='.$lat.','.$lng.'&zoom=14&size=600x300&markers='.$marker.'&key=YOUR_GOOGLE_STATIC_MAPS_API_KEY"></a>';
Task: Create a slider from the entries of an an XML-File.
Design draft is here: http://pascha.org/aufgabe/slider.png
XML-File is here: http://pascha.org/aufgabe/comments.xml
Icons & Elements: http://pascha.org/aufgabe/pascha.org-aufgabe-icons.zip
– You can use jQuery
– The entries in the XML are pointing to facebook or google, so the respective logo should be shown in the slider.
– The Slider should jump from the last to the first entry.
The slider should be draggable and use touchevents.
– The “Read more”-Button (“weiterlesen”) should be linked to the respective page.
To show the content of a directory in PHP and make the files like images etc downloadable without changing the Webserver config, upload this snippet as index.php to the directory.
To scroll smoothly to an anchor on your webpage with jQuery, you can use following snippet:
anchor = $(this).attr('href');
If you want to move elements around the screen in multiple steps, you can use CSS animations for that.
If you want to move an element to a screen corner with CSS only, theres a simple Solution with CSS3.
Small Dropdown snippet:
with jQuery, all you need are just 3 lines of js and you have created a dropdown: