踩到Window resize在Preview print的雷
最近在作案的過程中遇到一個狀況,從Art design那邊拿到的頁面,會在Window resize的時候執行某個Function,本來一切都正常,但測試到Chrome和Firefox預覽列印時發現也會Trigger這個Event,會讓在預覽列印過後的頁面發生問題,所以必須要進行修正,以下是這個案例的說明:
先在測試頁加入以下的程式,發現在預覽列印的時候會Trigger window resize event:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Preview Print Test</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(window).resize(function() { console.log("Window Resize"); }); </script> </head> <body> <h1>Window Resize Test</h1> </body> </html>


網路上搜尋了一下解決方案,將Script改寫如下,可以順利解決,但不知道是不是最好的方法,如果大家有更好的也別忘了告訴我唷~
openResizeFn(); // Chorme var print = false; var mediaQueryList = window.matchMedia('print'); mediaQueryList.addListener(function (mql) { if (mql.matches) { closeResizeFn(); } else { setTimeout(openResizeFn, 2000); } }); // Firefox window.onbeforeprint = function () { closeResizeFn(); }; window.onafterprint = function () { setTimeout(openResizeFn, 2000); }; // Common Function function openResizeFn() { $(window).on("resize", windowResize); } function closeResizeFn() { $(window).off("resize", windowResize); } function windowResize() { console.log("Window Resize"); }
dark web market dark web sites
kamagra Kamagra kaufen ohne Rezept Kamagra kaufen ohne Rezept
Kamagra Oral Jelly: kamagra – Kamagra kaufen
darknet markets onion darknet site
http://kamagrapotenzmittel.com/# Kamagra Original
apotek online recept: Apotek hemleverans recept – Apoteket online
darkmarkets dark web marketplaces
http://apotekonlinerecept.com/# Apoteket online
dark market onion darknet market lists
dark web sites dark web market urls
dark market 2025 dark web market list
http://apotekonlinerecept.com/# apotek pa nett
http://kamagrapotenzmittel.com/# Kamagra Original
best darknet markets darknet links
Kamagra Original: Kamagra online bestellen – Kamagra Oral Jelly
https://apotheekmax.com/# Betrouwbare online apotheek zonder recept
Kamagra kaufen Kamagra online bestellen Kamagra Gel
Iceberg flotillas
debridge
Located on the west coast, Ilulissat is a pretty halibut- and prawn-fishing port on a dark rock bay where visitors can sit in pubs sipping craft beers chill-filtered by 100,000-year-old glacial ice.
It’s a place to be awed by the UNESCO World Heritage Icefjord where Manhattan skyscraper-sized icebergs disgorge from Greenland’s icecap to float like ghostly ships in the surrounding Disko Bay.
Small boats take visitors out to sail closely among the bay’s magnificent iceberg flotilla. But not too close.
“I was on my boat once and saw one of these icebergs split in two. The pieces fell backwards into the sea and created a giant wave,” said David Karlsen, skipper of the pleasure-boat, Katak. “…I didn’t hang around.”
Disko Bay’s other giants are whales. From June to September breaching humpback whales join the likes of fin and minke whales feasting on plankton. Whale-watching is excellent all around Greenland’s craggy coastline.
Whales are eaten here. Visitors shouldn’t be surprised to encounter the traditional Greenlandic delicacy of mattak — whale-skin and blubber that when tasted is akin to chewing on rubber. Inuit communities have quotas to not only hunt the likes of narwhals but also polar bears, musk-ox and caribou — which can also appear on menus.
A long time in the making
Curiosity landed in Gale Crater on August 6, 2012. More than 12 years later, the rover has driven over 21 miles (34 kilometers) to ascend Mount Sharp, which is within the crater. The feature’s many layers preserve millions of years of geological history on Mars, showing how it shifted from a wet to a dry environment.
cbridge
Perhaps one of the most valuable samples Curiosity has gathered on its mission to understand whether Mars was ever habitable was collected in May 2013.
The rover drilled the Cumberland sample from an area within a crater called Yellowknife Bay, which resembled an ancient lake bed. The rocks from Yellowknife Bay so intrigued Curiosity’s science team that it had the rover drive in the opposite direction to collect samples from the area before heading to Mount Sharp.
Since collecting the Cumberland sample, Curiosity has used SAM to study it in a variety of ways, revealing that Yellowknife Bay was once the site of an ancient lake where clay minerals formed in water. The mudstone created an environment that could concentrate and preserve organic molecules and trapped them inside the fine grains of the sedimentary rock.
Freissinet helped lead a research team in 2015 that was able to identify organic molecules within the Cumberland sample.
The instrument detected an abundance of sulfur, which can be used to preserve organic molecules; nitrates, which are essential for plant and animal health on Earth; and methane composed of a type of carbon associated with biological processes on Earth.
“There is evidence that liquid water existed in Gale Crater for millions of years and probably much longer, which means there was enough time for life-forming chemistry to happen in these crater-lake environments on Mars,” said study coauthor Daniel Glavin, senior scientist for sample return at NASA’s Goddard Space Flight Center in Greenbelt, Maryland, in a statement.
‘For the public to enjoy’
keplr wallet
The museum’s history starts in 1998, when Sheikh Faisal Bin Qassim Al Thani opened a building to the public on his farm some 20 kilometers (12 miles) north of Qatari capital Doha.
A distant relative of Qatar’s ruling family, founder and chairman of Al Faisal Holdings (one of Qatar’s biggest conglomerates), and a billionaire whose business acumen had him recognized as one of the most influential Arab businessmen in the world, Sheikh Faisal had already amassed a substantial private collection of historically important regional artifacts, plus a few quirky pieces of interest, allowing visitors an intimate look into Qatari life and history.
In an interview with Qatari channel Alrayyan TV in 2018, Sheikh Faisal said that the museum started as a hobby.
“I used to collect items whenever I got the chance,” he said. “As my business grew, so did my collections, and soon I was able to collect more and more items until I decided to put them in the museum for the public to enjoy.”
His private cabinet of curiosities has since evolved into a 130-acre complex. Through the fort-like entrance gate lies an oryx reserve, an impressive riding school and stables, a duck pond and a mosque built with a quirky leaning minaret. There’s now even a five-star Marriott hotel, two cafes and the Zoufa restaurant serving modern Lebanese cuisine.
Of course, there’s also the super-sized museum, with a recently-opened car collection housing everything from vintage Rolls-Royces to wartime Jeeps and colorful Buicks. Outside you’ll find peacocks roaming the grounds, and signs warning drivers to be aware of horses and ostriches.
Visitors to the FBQ museum are free to explore the grounds and can even enter the stables to pat the horses.
darknet links darknet markets onion
Kraken darknet market – Кракен ссылки, Даркнет маркет
dark web link tor drug market
best darknet markets darknet market lists
Great post. Just a heads up – I am running Ubuntu with the beta of Firefox and the navigation of your blog is kind of broken for me.
Kamagra Oral Jelly: Kamagra online bestellen – Kamagra online bestellen
dark web markets dark market url
darkmarket 2025 best darknet markets
кракен – кракен, Даркнет маркет
dark market link darkmarket